Skip to content

Commit

Permalink
doc(dispatcher): add warn
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Miao committed Apr 30, 2024
1 parent bb8734e commit 3828594
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compio-dispatcher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ impl Dispatcher {
/// # Error
///
/// If all threads have panicked, this method will return an error with the
/// sent closure.
/// sent closure. Notice that the returned closure is not the same as the
/// argument and cannot be simply transmuted back to `Fn`.
pub fn dispatch<Fut, Fn>(&self, f: Fn) -> Result<(), SendError<Box<Closure>>>
where
Fn: (FnOnce() -> Fut) + Send + 'static,
Expand All @@ -144,7 +145,8 @@ impl Dispatcher {
/// # Error
///
/// If all threads have panicked, this method will return an error with the
/// sent closure.
/// sent closure. Notice that the returned closure is not the same as the
/// argument and cannot be simply transmuted back to `Fn`.
pub fn execute<Fut, Fn, R>(&self, f: Fn) -> Result<Executing<R>, SendError<Box<Closure>>>
where
Fn: (FnOnce() -> Fut) + Send + 'static,
Expand Down

0 comments on commit 3828594

Please sign in to comment.