Struct wasmer_wasix::syscalls::Context
1.36.0 · source · pub(crate) struct Context<'a> {
waker: &'a Waker,
local_waker: &'a LocalWaker,
ext: AssertUnwindSafe<ExtData<'a>>,
_marker: PhantomData<fn(_: &'a ()) -> &'a ()>,
_marker2: PhantomData<*mut ()>,
}
Expand description
The context of an asynchronous task.
Currently, Context
only serves to provide access to a &Waker
which can be used to wake the current task.
Fields§
§waker: &'a Waker
§local_waker: &'a LocalWaker
§ext: AssertUnwindSafe<ExtData<'a>>
§_marker: PhantomData<fn(_: &'a ()) -> &'a ()>
§_marker2: PhantomData<*mut ()>
Implementations§
source§impl<'a> Context<'a>
impl<'a> Context<'a>
1.36.0 (const: unstable) · sourcepub fn from_waker(waker: &'a Waker) -> Context<'a>
pub fn from_waker(waker: &'a Waker) -> Context<'a>
Create a new Context
from a &Waker
.
1.36.0 (const: unstable) · sourcepub fn waker(&self) -> &'a Waker
pub fn waker(&self) -> &'a Waker
Returns a reference to the Waker
for the current task.
sourcepub const fn local_waker(&self) -> &'a LocalWaker
🔬This is a nightly-only experimental API. (local_waker
)
pub const fn local_waker(&self) -> &'a LocalWaker
local_waker
)Returns a reference to the LocalWaker
for the current task.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Context<'a>
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> !Send for Context<'a>
impl<'a> !Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnwindSafe for Context<'a>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.