Skip to content

Commit 3828594

Browse files
committed
doc(dispatcher): add warn
1 parent bb8734e commit 3828594

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compio-dispatcher/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ impl Dispatcher {
126126
/// # Error
127127
///
128128
/// If all threads have panicked, this method will return an error with the
129-
/// sent closure.
129+
/// sent closure. Notice that the returned closure is not the same as the
130+
/// argument and cannot be simply transmuted back to `Fn`.
130131
pub fn dispatch<Fut, Fn>(&self, f: Fn) -> Result<(), SendError<Box<Closure>>>
131132
where
132133
Fn: (FnOnce() -> Fut) + Send + 'static,
@@ -144,7 +145,8 @@ impl Dispatcher {
144145
/// # Error
145146
///
146147
/// If all threads have panicked, this method will return an error with the
147-
/// sent closure.
148+
/// sent closure. Notice that the returned closure is not the same as the
149+
/// argument and cannot be simply transmuted back to `Fn`.
148150
pub fn execute<Fut, Fn, R>(&self, f: Fn) -> Result<Executing<R>, SendError<Box<Closure>>>
149151
where
150152
Fn: (FnOnce() -> Fut) + Send + 'static,

0 commit comments

Comments
 (0)