pub struct ErasedHandler(/* private fields */);Expand description
Shared, type-erased handler. Clones retain the same handler allocation.
Implements Send + Sync on native targets, but not on WASM.
Implementations§
Source§impl ErasedHandler
impl ErasedHandler
Sourcepub fn layered(self, intercept: impl Intercept) -> Self
pub fn layered(self, intercept: impl Intercept) -> Self
Wrap this handler in a Layer: intercept sees
every dispatch before this handler does and every answer after.
handler.layered(a).layered(b) calls b.before first and a.after first.
Sourcepub fn descriptor(&self) -> HandlerDescriptor
pub fn descriptor(&self) -> HandlerDescriptor
What the erased handler is.
Sourcepub fn handle(&self, kind: EffectKind, dispatch: Dispatch) -> HandlerFuture<'_>
pub fn handle(&self, kind: EffectKind, dispatch: Dispatch) -> HandlerFuture<'_>
Serve one effect: the driver’s call, straight to the boxed handler.
Trait Implementations§
Source§impl Clone for ErasedHandler
impl Clone for ErasedHandler
Source§impl Debug for ErasedHandler
impl Debug for ErasedHandler
Source§impl Serve for ErasedHandler
Forwards serving to the wrapped handler; re-erasure adds another boxed future.
impl Serve for ErasedHandler
Forwards serving to the wrapped handler; re-erasure adds another boxed future.
Source§fn descriptor(&self) -> HandlerDescriptor
fn descriptor(&self) -> HandlerDescriptor
What this handler is: the family-keyed description a typed view
checks at bind time and a scene serializes.
Auto Trait Implementations§
impl !RefUnwindSafe for ErasedHandler
impl !UnwindSafe for ErasedHandler
impl Freeze for ErasedHandler
impl Send for ErasedHandler
impl Sync for ErasedHandler
impl Unpin for ErasedHandler
impl UnsafeUnpin for ErasedHandler
Blanket Implementations§
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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