Skip to main content

Pure

Struct Pure 

Source
pub struct Pure<S, O = Never, Br = NoBirths, E = Never>
where S: Handler<O, Br, E>, Br: BirthMode,
{ /* private fields */ }

Implementations§

Source§

impl<S, O, Br, E> Pure<S, O, Br, E>
where S: Handler<O, Br, E>, Br: BirthMode,

Source

pub fn new(state: S) -> Pure<S, O, Br, E>

Source

pub fn state(&self) -> &S

Source§

impl<S, F, A, M, O, Br, E> Pure<FoldFn<S, A, M, O, Br, E, F>, O, Br, E>
where A: Address, Br: BirthMode, F: FnMut(&mut S, A, M) -> Result<Actions<A, Never, Vec<Delivery<A, O>>, Br>, E>,

Source

pub fn from_fn( state: S, transition: F, ) -> Pure<FoldFn<S, A, M, O, Br, E, F>, O, Br, E>

Trait Implementations§

Source§

impl<S, O, Br, E> Behavior for Pure<S, O, Br, E>
where S: Handler<O, Br, E>, Br: BirthMode,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Ph = Never

Source§

type Error = E

Source§

type Birth = Br

Source§

fn init( &mut self, ) -> Result<Actions<<S as Handler<O, Br, E>>::Addr, Never, Vec<Delivery<<S as Handler<O, Br, E>>::Addr, O>>, Br>, E>

Produce initialization actions before the first event is accepted. Read more
Source§

fn transition( &mut self, event: <Pure<S, O, Br, E> as Behavior>::Event, ) -> Result<Actions<<S as Handler<O, Br, E>>::Addr, Never, Vec<Delivery<<S as Handler<O, Br, E>>::Addr, O>>, Br>, E>

Fold exactly one event into explicit actions and the next behavior. Read more
Source§

fn receive( &mut self, from: Self::Addr, message: Self::Msg, ) -> Result<Actions<Self::Addr, Self::Ph, Self::Sends, Self::Birth>, Self::Error>
where Self: Sized,

Fold one user communication through the composed protocol. Read more
Source§

fn on<Input>( &mut self, input: Input, ) -> Result<Actions<Self::Addr, Self::Ph, Self::Sends, Self::Birth>, Self::Error>
where Self: Sized, Self::Event: EventInput<Input>,

Inject one supported semantic input and fold it through this behavior. Read more

Auto Trait Implementations§

§

impl<S, O, Br, E> Freeze for Pure<S, O, Br, E>
where S: Freeze,

§

impl<S, O, Br, E> RefUnwindSafe for Pure<S, O, Br, E>
where S: RefUnwindSafe,

§

impl<S, O, Br, E> Send for Pure<S, O, Br, E>
where S: Send,

§

impl<S, O, Br, E> Sync for Pure<S, O, Br, E>
where S: Sync,

§

impl<S, O, Br, E> Unpin for Pure<S, O, Br, E>
where S: Unpin,

§

impl<S, O, Br, E> UnsafeUnpin for Pure<S, O, Br, E>
where S: UnsafeUnpin,

§

impl<S, O, Br, E> UnwindSafe for Pure<S, O, Br, E>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.