Struct Channel

Source
pub struct Channel<Msg: Message> { /* private fields */ }
Expand description

A specialized actor for providing Publish/Subscribe capabilities for user level messages

Trait Implementations§

Source§

impl<Msg> Actor for Channel<Msg>
where Msg: Message,

Source§

type Msg = ChannelMsg<Msg>

Source§

fn pre_start(&mut self, _ctx: &Context<ChannelMsg<Msg>>)

Invoked when an actor is being started by the system. Read more
Source§

fn recv( &mut self, ctx: &Context<ChannelMsg<Msg>>, msg: ChannelMsg<Msg>, sender: Sender, )

Invoked when an actor receives a message Read more
Source§

fn sys_recv( &mut self, _: &Context<ChannelMsg<Msg>>, msg: SystemMsg, _sender: Sender, )

Invoked when an actor receives a system message Read more
Source§

fn post_start(&mut self, _ctx: &Context<Self::Msg>)

Invoked after an actor has started. Read more
Source§

fn post_stop(&mut self)

Invoked after an actor has been stopped.
Source§

fn supervisor_strategy(&self) -> Strategy

Return a supervisor strategy that will be used when handling failed child actors.
Source§

impl<Msg: Message> Default for Channel<Msg>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Msg> Receive<ChannelMsg<Msg>> for Channel<Msg>
where Msg: Message,

Source§

type Msg = ChannelMsg<Msg>

Source§

fn receive( &mut self, ctx: &Context<ChannelMsg<Msg>>, msg: Self::Msg, sender: Sender, )

Invoked when an actor receives a message Read more
Source§

impl<Msg> Receive<Publish<Msg>> for Channel<Msg>
where Msg: Message,

Source§

type Msg = ChannelMsg<Msg>

Source§

fn receive( &mut self, _ctx: &Context<ChannelMsg<Msg>>, msg: Publish<Msg>, sender: Sender, )

Invoked when an actor receives a message Read more
Source§

impl<Msg> Receive<Subscribe<Msg>> for Channel<Msg>
where Msg: Message,

Source§

type Msg = ChannelMsg<Msg>

Source§

fn receive( &mut self, _ctx: &Context<ChannelMsg<Msg>>, msg: Subscribe<Msg>, _sender: Sender, )

Invoked when an actor receives a message Read more
Source§

impl<Msg> Receive<Unsubscribe<Msg>> for Channel<Msg>
where Msg: Message,

Source§

type Msg = ChannelMsg<Msg>

Source§

fn receive( &mut self, _ctx: &Context<ChannelMsg<Msg>>, msg: Unsubscribe<Msg>, _sender: Sender, )

Invoked when an actor receives a message Read more
Source§

impl<Msg> Receive<UnsubscribeAll<Msg>> for Channel<Msg>
where Msg: Message,

Source§

type Msg = ChannelMsg<Msg>

Source§

fn receive( &mut self, _ctx: &Context<ChannelMsg<Msg>>, msg: UnsubscribeAll<Msg>, _sender: Sender, )

Invoked when an actor receives a message Read more

Auto Trait Implementations§

§

impl<Msg> Freeze for Channel<Msg>

§

impl<Msg> !RefUnwindSafe for Channel<Msg>

§

impl<Msg> Send for Channel<Msg>

§

impl<Msg> !Sync for Channel<Msg>

§

impl<Msg> Unpin for Channel<Msg>

§

impl<Msg> !UnwindSafe for Channel<Msg>

Blanket Implementations§

Source§

impl<A> ActorFactory for A
where A: Default + Actor,

Source§

fn create() -> A

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V