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 value.
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".