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;
type Effect;
type Done;
// Required methods
fn init(
&mut self,
) -> impl Future<Output = Result<Self::Effect, Self::Error>> + Send;
fn step(
&mut self,
event: Self::Event,
) -> impl Future<Output = Result<Self::Effect, Self::Error>> + Send;
}Expand description
A composed pure behavior. Event is the complete accepted protocol;
successful transitions always return the same Agha effect algebra.
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
type Effect
type Done
Required Methods§
fn init( &mut self, ) -> impl Future<Output = Result<Self::Effect, Self::Error>> + Send
fn step( &mut self, event: Self::Event, ) -> impl Future<Output = Result<Self::Effect, Self::Error>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".