Skip to main content

Pure

Struct Pure 

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

Implementations§

Source§

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

Source

pub fn new(state: S) -> Self

Source

pub fn state(&self) -> &S

Source§

impl<S, F, A: Address, M, Sends, Br: BirthMode, E> Pure<FoldFn<S, A, M, Sends, Br, E, F>, Sends, Br, E>
where Sends: SendAlgebra, F: FnMut(&mut S, A, M) -> Acted<A, Never, Sends, Br, E>,

Source

pub fn from_fn(state: S, transition: F) -> Self

Trait Implementations§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Sends = Sends

Source§

type Ph = Never

Source§

type Error = E

Source§

type Birth = Br

Source§

fn init(&mut self) -> Acted<S::Addr, Never, Sends, Br, E>

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

fn transition( &mut self, event: Self::Event, ) -> Acted<S::Addr, Never, Sends, 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, ) -> BehaviorActed<Self>
where Self: Sized,

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

fn on<Input>(&mut self, input: Input) -> BehaviorActed<Self>
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, Sends, Br, E> Freeze for Pure<S, Sends, Br, E>
where S: Freeze,

§

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

§

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

§

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

§

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

§

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

§

impl<S, Sends, Br, E> UnwindSafe for Pure<S, Sends, 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.