pub struct BehaviorFn<S, A: Address, M, Sends, Br: BirthMode, E, I, F> { /* private fields */ }Expand description
A concrete behavior defined by initialization and user-event folds.
Each function is invoked exactly once for its corresponding input and its
returned Actions value is preserved unchanged. This adapter adds no
event routing or effect interpretation; those remain the responsibility of
concrete behavior wrappers and the runtime interpreter.
Implementations§
Source§impl<S, A: Address, M, Sends, Br: BirthMode, E, I, F> BehaviorFn<S, A, M, Sends, Br, E, I, F>
impl<S, A: Address, M, Sends, Br: BirthMode, E, I, F> BehaviorFn<S, A, M, Sends, Br, E, I, F>
Trait Implementations§
Source§impl<S, A: Address, M, Sends, Br: BirthMode, E, I, F> Behavior for BehaviorFn<S, A, M, Sends, Br, E, I, F>
impl<S, A: Address, M, Sends, Br: BirthMode, E, I, F> Behavior for BehaviorFn<S, A, M, Sends, Br, E, I, F>
type Addr = A
type Msg = M
type Event = User<A, M>
type Sends = Sends
type Ph = Never
type Error = E
type Birth = Br
Source§fn init(&mut self) -> BehaviorActed<Self>
fn init(&mut self) -> BehaviorActed<Self>
Produce initialization actions before the first event is accepted. Read more
Source§fn transition(&mut self, event: Self::Event) -> BehaviorActed<Self>
fn transition(&mut self, event: Self::Event) -> BehaviorActed<Self>
Fold exactly one event into explicit actions and the next behavior. Read more
Source§fn receive(
&mut self,
from: Self::Addr,
message: Self::Msg,
) -> BehaviorActed<Self>where
Self: Sized,
fn receive(
&mut self,
from: Self::Addr,
message: Self::Msg,
) -> BehaviorActed<Self>where
Self: Sized,
Fold one user communication through the composed protocol. Read more
Source§fn on<Input>(&mut self, input: Input) -> BehaviorActed<Self>
fn on<Input>(&mut self, input: Input) -> BehaviorActed<Self>
Inject one supported semantic input and fold it through this behavior. Read more
Auto Trait Implementations§
impl<S, A, M, Sends, Br, E, I, F> Freeze for BehaviorFn<S, A, M, Sends, Br, E, I, F>
impl<S, A, M, Sends, Br, E, I, F> RefUnwindSafe for BehaviorFn<S, A, M, Sends, Br, E, I, F>
impl<S, A, M, Sends, Br, E, I, F> Send for BehaviorFn<S, A, M, Sends, Br, E, I, F>
impl<S, A, M, Sends, Br, E, I, F> Sync for BehaviorFn<S, A, M, Sends, Br, E, I, F>
impl<S, A, M, Sends, Br, E, I, F> Unpin for BehaviorFn<S, A, M, Sends, Br, E, I, F>
impl<S, A, M, Sends, Br, E, I, F> UnsafeUnpin for BehaviorFn<S, A, M, Sends, Br, E, I, F>
impl<S, A, M, Sends, Br, E, I, F> UnwindSafe for BehaviorFn<S, A, M, Sends, Br, E, I, F>
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