Skip to main content

Behavior

Trait Behavior 

Source
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§

Required Methods§

Source

fn init( &mut self, ) -> impl Future<Output = Result<Self::Effect, Self::Error>> + Send

Source

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

Implementors§

Source§

impl<A, S, M, P, E> Behavior for Fsm<A, S, M, P, E>
where A: Address + Send, A::Nonce: Send, S: Send, M: Send, P: Copy + PartialEq + Send, E: Send,

Source§

type Addr = A

Source§

type Msg = M

Source§

type Event = User<A, M>

Source§

type Sends = Vec<Delivery<A, Never>>

Source§

type Ph = Never

Source§

type Error = E

Source§

type Birth = NoBirths

Source§

type Effect = Actions<A, Never, <Fsm<A, S, M, P, E> as Behavior>::Sends, NoBirths>

Source§

type Done = Exit<A>

Source§

impl<B, A, Ph, Sends, Br> Behavior for At<B>
where A: Address + Send, Sends: SendAlgebra, Br: BirthMode, B: Behavior<Addr = A, Ph = Ph, Sends = Sends, Birth = Br, Effect = Actions<A, Ph, Sends, Br>, Done = Exit<A>> + Send, B::Event: TimeEvent + Send, B::Msg: Send,

Source§

type Addr = A

Source§

type Msg = <B as Behavior>::Msg

Source§

type Event = AtEvent<<B as Behavior>::Event>

Source§

type Sends = SendProduct<Sends, Vec<ScheduleAt>>

Source§

type Ph = Ph

Source§

type Error = <B as Behavior>::Error

Source§

type Birth = Br

Source§

type Effect = Actions<A, Ph, <At<B> as Behavior>::Sends, Br>

Source§

type Done = Exit<A>

Source§

impl<B, A, Ph, Sends, Br> Behavior for Spec<B>
where A: Address + Send, Sends: SendAlgebra, Br: BirthMode, B: Behavior<Addr = A, Ph = Ph, Sends = Sends, Birth = Br, Effect = Actions<A, Ph, Sends, Br>, Done = Exit<A>> + Send, A::Nonce: Send, B::Msg: Send, B::Event: Send,

Source§

type Addr = A

Source§

type Msg = <B as Behavior>::Msg

Source§

type Event = <B as Behavior>::Event

Source§

type Sends = Sends

Source§

type Ph = Ph

Source§

type Error = <B as Behavior>::Error

Source§

type Birth = Br

Source§

type Effect = <B as Behavior>::Effect

Source§

type Done = <B as Behavior>::Done

Source§

impl<B, A, Ph, Sends, Br> Behavior for Watching<B>
where A: Address + Send, Sends: SendAlgebra, Br: BirthMode, B: Behavior<Addr = A, Ph = Ph, Sends = Sends, Birth = Br, Effect = Actions<A, Ph, Sends, Br>, Done = Exit<A>> + Send, B::Event: PeerEvent<B::Addr> + Send, B::Msg: Send,

Source§

type Addr = A

Source§

type Msg = <B as Behavior>::Msg

Source§

type Event = WatchEvent<<B as Behavior>::Event, <B as Behavior>::Addr>

Source§

type Sends = SendProduct<Sends, Vec<Delivery<A, ObservePeer<A>>>>

Source§

type Ph = Ph

Source§

type Error = <B as Behavior>::Error

Source§

type Birth = Br

Source§

type Effect = Actions<A, Ph, <Watching<B> as Behavior>::Sends, Br>

Source§

type Done = Exit<A>

Source§

impl<B, A, Sends, Br> Behavior for Stashing<B>
where A: Address + Send, Sends: SendAlgebra + Send, Br: BirthMode, B: Behavior<Addr = A, Ph = Never, Sends = Sends, Birth = Br, Effect = Actions<A, Never, Sends, Br>, Done = Exit<A>> + Send, A::Nonce: Send, B::Msg: Send, B::Event: Send, Br::Child: Send,

Source§

type Addr = A

Source§

type Msg = <B as Behavior>::Msg

Source§

type Event = <B as Behavior>::Event

Source§

type Sends = Sends

Source§

type Ph = Never

Source§

type Error = <B as Behavior>::Error

Source§

type Birth = Br

Source§

type Effect = Actions<A, Never, Sends, Br>

Source§

type Done = Exit<A>

Source§

impl<B, C, A, Ph, Sends> Behavior for Supervising<B, C>
where A: Address + Send, Sends: SendAlgebra, B: Behavior<Addr = A, Ph = Ph, Sends = Sends, Birth = Births<C>, Effect = Actions<A, Ph, Sends, Births<C>>, Done = Exit<A>> + Send, B::Event: ChildEvent<B::Addr> + Send, A::Nonce: From<u64> + Send, B::Msg: Send, C: Behavior<Ph = Never, Addr = B::Addr> + Send,

Source§

impl<C> Behavior for Proxy<C>
where C: Behavior<Ph = Never> + Send, C::Addr: Send, <C::Addr as Address>::Nonce: From<u64> + Send, C::Msg: Send,

Source§

impl<S, O, Br, E> Behavior for Base<S, O, Br, E>
where S: State<O, Br, E> + Send, S::Addr: Send, S::Msg: Send, Br: BirthMode, Br::Child: Send, E: Send,

Source§

type Addr = <S as State<O, Br, E>>::Addr

Source§

type Msg = <S as State<O, Br, E>>::Msg

Source§

type Event = User<<S as State<O, Br, E>>::Addr, <S as State<O, Br, E>>::Msg>

Source§

type Sends = Vec<Delivery<<S as State<O, Br, E>>::Addr, O>>

Source§

type Ph = Never

Source§

type Error = E

Source§

type Birth = Br

Source§

type Effect = Actions<<S as State<O, Br, E>>::Addr, Never, <Base<S, O, Br, E> as Behavior>::Sends, Br>

Source§

type Done = Exit<<S as State<O, Br, E>>::Addr>