pub struct Active<B: Behavior> { /* private fields */ }Expand description
A behavior whose initialization fold has completed exactly once.
Active<B> does not implement Behavior, so initialization cannot be
repeated through the public API:
ⓘ
use behavior::{Behavior, Compose, Machine, MailAddr, Move, Never};
let definition: Compose<Machine<MailAddr, (), u8, (), Never>> =
Compose::new(Machine::new((), (), |_, _, _| Ok(Move::Stay)));
let active = definition.initialize().unwrap().behavior;
active.initialize();Implementations§
Source§impl<B: Behavior> Active<B>
impl<B: Behavior> Active<B>
pub fn base(&self) -> &B::Basewhere
B: BehaviorBase,
pub fn stashed(&self) -> usizewhere
B: StashStatus,
Sourcepub fn transition(&mut self, event: B::Event) -> BehaviorActed<B>
pub fn transition(&mut self, event: B::Event) -> BehaviorActed<B>
Fold exactly one event after initialization.
Sourcepub fn receive(&mut self, from: B::Addr, message: B::Msg) -> BehaviorActed<B>
pub fn receive(&mut self, from: B::Addr, message: B::Msg) -> BehaviorActed<B>
Fold one user communication after initialization.
Sourcepub fn on<Input>(&mut self, input: Input) -> BehaviorActed<B>where
B::Event: EventInput<Input>,
pub fn on<Input>(&mut self, input: Input) -> BehaviorActed<B>where
B::Event: EventInput<Input>,
Fold one statically supported semantic input after initialization.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Active<B>where
B: Freeze,
impl<B> RefUnwindSafe for Active<B>where
B: RefUnwindSafe,
impl<B> Send for Active<B>where
B: Send,
impl<B> Sync for Active<B>where
B: Sync,
impl<B> Unpin for Active<B>where
B: Unpin,
impl<B> UnsafeUnpin for Active<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for Active<B>where
B: UnwindSafe,
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