[][src]Struct appliance::Appliance

pub struct Appliance<M> { /* fields omitted */ }

A stateful entity that only allows to interact with via handling messages.

Implementations

impl<M> Appliance<M>[src]

pub fn strong_count(this: &Self) -> usize[src]

Returns the number of strong pointers (clones) of a given appliance.

impl<'a, M: Send + 'a> Appliance<M>[src]

pub fn new<S: Send + 'a>(
    executor: &Executor<'a>,
    mut state: S,
    handler: impl Fn(&mut S, M) + Send + 'a,
    message_bus_size: Option<usize>
) -> Self
[src]

Creates a new appliance.

pub fn handle(&self, message: M) -> Result<(), Error>[src]

Processes a message on the current appliance.

Trait Implementations

impl<M> Clone for Appliance<M>[src]

impl<M: Debug> Debug for Appliance<M>[src]

impl<M> Drop for Appliance<M>[src]

impl<M> Send for Appliance<M>[src]

impl<M> Sync for Appliance<M>[src]

Auto Trait Implementations

impl<M> !RefUnwindSafe for Appliance<M>[src]

impl<M> Unpin for Appliance<M>[src]

impl<M> !UnwindSafe for Appliance<M>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.