MpscDispatcher

Struct MpscDispatcher 

Source
pub struct MpscDispatcher { /* private fields */ }
Expand description

An object that register reactive::Behavior and dispatch messages for them.

The proper way to construct it is to use Builder.

Implementations§

Source§

impl MpscDispatcher

Source

pub fn process(&mut self)

Process messages until dispatcher::Request::StopDispatcher is received.

Trait Implementations§

Source§

impl Dispatcher for MpscDispatcher

Source§

fn addr(&self) -> Addr

Return the actor address of the dispatcher itself.
Source§

fn register_reactive(&mut self, behavior: Box<dyn Behavior>) -> Addr

Migrate a reactive inside the dispatcher and return an actor address to it.
Source§

fn replace_reactive( &mut self, addr: &Addr, behavior: Box<dyn Behavior>, ) -> Result<Box<dyn Behavior>, Box<dyn Behavior>>

Replace an implementation of a reactive by a new one. This only change the object that responds to process message. This is thread safe but of course the management of new and old inner states transition should be taken into account. All copies of the address are still valid. Read more
Source§

fn unregister_reactive(&mut self, addr: &Addr) -> Option<Box<dyn Behavior>>

Extract a reactive from the dispatcher by it address.
Source§

fn own_addr(&self) -> Addr

👎Deprecated: use the better named addr()
Source§

impl Drop for MpscDispatcher

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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.