pub enum Spawn<S: Spawner> {
Spawner(S),
Child(S::Child),
}Expand description
Composes two state machines where of the state machines spawns multiple instances of another one
Variants§
Trait Implementations§
Source§impl<S, C, D> Machine for Spawn<S>
impl<S, C, D> Machine for Spawn<S>
Source§type Context = <<S as Spawner>::Child as Machine>::Context
type Context = <<S as Spawner>::Child as Machine>::Context
Context type for the state machine Read more
Source§type Seed = <S as Spawner>::Seed
type Seed = <S as Spawner>::Seed
Seed is piece of data that is needed to initialize the machine Read more
Source§fn create(
seed: <S as Spawner>::Seed,
scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Void>
fn create( seed: <S as Spawner>::Seed, scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Void>
Create a machine from some data Read more
Source§fn ready(
self,
events: EventSet,
scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Self::Seed>
fn ready( self, events: EventSet, scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Self::Seed>
Socket readiness notification
Source§fn spawned(
self,
scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Self::Seed>
fn spawned( self, scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Self::Seed>
Called after spawn event Read more
Source§fn timeout(
self,
scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Self::Seed>
fn timeout( self, scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Self::Seed>
Timeout happened
Source§fn wakeup(
self,
scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Self::Seed>
fn wakeup( self, scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Self::Seed>
Message received Read more
Source§fn spawn_error(
self,
_scope: &mut Scope<'_, Self::Context>,
error: SpawnError<Self::Seed>,
) -> Response<Self, Self::Seed>
fn spawn_error( self, _scope: &mut Scope<'_, Self::Context>, error: SpawnError<Self::Seed>, ) -> Response<Self, Self::Seed>
Called instead of spawned, if there is no slab space Read more
Auto Trait Implementations§
impl<S> Freeze for Spawn<S>
impl<S> RefUnwindSafe for Spawn<S>
impl<S> Send for Spawn<S>
impl<S> Sync for Spawn<S>
impl<S> Unpin for Spawn<S>
impl<S> UnsafeUnpin for Spawn<S>
impl<S> UnwindSafe for Spawn<S>
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