/// Create a new [`Waker`] which does /// nothing when `wake()` is called on it. /// /// # Examples /// /// ``` /// use futures::task::noop_waker; /// let waker = noop_waker(); /// waker.wake(); /// ``` #[inline] pubfn noop_waker() -> Waker { // FIXME: Since 1.46.0 we can use transmute in consts, allowing this function to be const. unsafe { Waker::from_raw(noop_raw_waker()) }
}
/// Get a static reference to a [`Waker`] which /// does nothing when `wake()` is called on it. /// /// # Examples /// /// ``` /// use futures::task::noop_waker_ref; /// let waker = noop_waker_ref(); /// waker.wake_by_ref(); /// ``` #[inline] pubfn noop_waker_ref() -> &'static Waker { struct SyncRawWaker(RawWaker); unsafeimpl Sync for SyncRawWaker {}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.