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,
impl<Msg> Actor for Channel<Msg>where
Msg: Message,
type Msg = ChannelMsg<Msg>
Source§fn pre_start(&mut self, _ctx: &Context<ChannelMsg<Msg>>)
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,
)
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,
)
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>)
fn post_start(&mut self, _ctx: &Context<Self::Msg>)
Invoked after an actor has started. Read more
Source§fn supervisor_strategy(&self) -> Strategy
fn supervisor_strategy(&self) -> Strategy
Return a supervisor strategy that will be used when handling failed child actors.
Source§impl<Msg> Receive<Unsubscribe<Msg>> for Channel<Msg>where
Msg: Message,
impl<Msg> Receive<Unsubscribe<Msg>> for Channel<Msg>where
Msg: Message,
type Msg = ChannelMsg<Msg>
Source§fn receive(
&mut self,
_ctx: &Context<ChannelMsg<Msg>>,
msg: Unsubscribe<Msg>,
_sender: Sender,
)
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,
impl<Msg> Receive<UnsubscribeAll<Msg>> for Channel<Msg>where
Msg: Message,
type Msg = ChannelMsg<Msg>
Source§fn receive(
&mut self,
_ctx: &Context<ChannelMsg<Msg>>,
msg: UnsubscribeAll<Msg>,
_sender: Sender,
)
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<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more