Struct RawWaker
struct RawWaker { ... }
A RawWaker allows the implementor of a task executor to create a Waker
or a LocalWaker which provides customized wakeup behavior.
It consists of a data pointer and a virtual function pointer table (vtable)
that customizes the behavior of the RawWaker.
RawWakers are unsafe to use.
Implementing the Wake trait is a safe alternative that requires memory allocation.
Implementations
impl RawWaker
const fn new(data: *const (), vtable: &'static RawWakerVTable) -> RawWakerCreates a new
RawWakerfrom the provideddatapointer andvtable.The
datapointer can be used to store arbitrary data as required by the executor. This could be e.g. a type-erased pointer to anArcthat is associated with the task. The value of this pointer will get passed to all functions that are part of thevtableas the first parameter.It is important to consider that the
datapointer must point to a thread safe type such as anArc<T: Send + Sync>when used to construct aWaker. This restriction is lifted when constructing aLocalWaker, which allows using types that do not implement[Send] + [Sync]likeRc<T>.The
vtablecustomizes the behavior of aWakerwhich gets created from aRawWaker. For each operation on theWaker, the associated function in thevtableof the underlyingRawWakerwill be called.
impl Debug for RawWaker
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for RawWaker
impl PartialEq for RawWaker
fn eq(self: &Self, other: &RawWaker) -> bool
impl RefUnwindSafe for RawWaker
impl Send for RawWaker
impl StructuralPartialEq for RawWaker
impl Sync for RawWaker
impl Unpin for RawWaker
impl UnsafeUnpin for RawWaker
impl UnwindSafe for RawWaker
impl<T> Any for RawWaker
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for RawWaker
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for RawWaker
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for RawWaker
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for RawWaker
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for RawWaker
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for RawWaker
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>