pub trait Behavior {
type Addr: Address;
type Msg;
type Event: UserEvent<Addr = Self::Addr, Message = Self::Msg>;
type Sends: SendAlgebra;
type Ph;
type Error;
type Birth: BirthMode;
// Required methods
fn init(&mut self) -> impl Future<Output = BehaviorActed<Self>> + Send;
fn step(
&mut self,
event: Self::Event,
) -> impl Future<Output = BehaviorActed<Self>> + Send;
}Expand description
A composed pure behavior. Event is the complete accepted protocol;
every successful transition returns the declared Actions algebra.
Effect and termination escape seats are intentionally absent:
ⓘ
use behavior::Behavior;
fn erased_effect<B: Behavior>() -> core::marker::PhantomData<B::Effect> {
core::marker::PhantomData
}Required Associated Types§
type Addr: Address
type Msg
type Event: UserEvent<Addr = Self::Addr, Message = Self::Msg>
type Sends: SendAlgebra
type Ph
type Error
type Birth: BirthMode
Required Methods§
fn init(&mut self) -> impl Future<Output = BehaviorActed<Self>> + Send
fn step( &mut self, event: Self::Event, ) -> impl Future<Output = BehaviorActed<Self>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".