Skip to main content

Base

Struct Base 

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

Implementations§

Source§

impl<S: State<O, Br, E>, O, Br: BirthMode, E> Base<S, O, Br, E>

Source

pub fn new(state: S) -> Self

Source

pub fn state(&self) -> &S

Source§

impl<S, A: Address, M, O, Br: BirthMode, E> Base<FnState<S, A, M, O, Br, E>, O, Br, E>

Source

pub fn from_fn( state: S, handle: fn(&mut S, A, M) -> Acted<A, Never, Vec<Delivery<A, O>>, Br, E>, ) -> Self

Trait Implementations§

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>

Source§

async fn init(&mut self) -> Result<Self::Effect, E>

Source§

async fn step(&mut self, event: Self::Event) -> Result<Self::Effect, E>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

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