mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
util: improve impl Send for ReusableBoxFuture docs (#4658)
This commit is contained in:
@@ -122,7 +122,12 @@ impl<T> Future for ReusableBoxFuture<'_, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The future stored inside ReusableBoxFuture<'_, T> must be Send.
|
// The future stored inside ReusableBoxFuture<'_, T> must be Send since the
|
||||||
|
// `new` and `set` and `try_set` methods only allow setting the future to Send
|
||||||
|
// futures.
|
||||||
|
//
|
||||||
|
// Note that T is the return type of the future, so its not relevant for
|
||||||
|
// whether the future itself is Send.
|
||||||
unsafe impl<T> Send for ReusableBoxFuture<'_, T> {}
|
unsafe impl<T> Send for ReusableBoxFuture<'_, T> {}
|
||||||
|
|
||||||
// The only method called on self.boxed is poll, which takes &mut self, so this
|
// The only method called on self.boxed is poll, which takes &mut self, so this
|
||||||
|
|||||||
Reference in New Issue
Block a user