pub struct Context<M> { /* private fields */ }Expand description
Actor’s API to itself
Implementations§
Source§impl<M> Context<M>
impl<M> Context<M>
Sourcepub async fn next_event(&mut self) -> Event<M>where
M: Unpin,
pub async fn next_event(&mut self) -> Event<M>where
M: Unpin,
Receive next event (message or signal)
Sourcepub async fn next_message(&mut self) -> Mwhere
M: Unpin,
pub async fn next_message(&mut self) -> Mwhere
M: Unpin,
Receive next message.
Sourcepub async fn next_signal(&mut self) -> Signal
pub async fn next_signal(&mut self) -> Signal
Receive next signal.
Sourcepub async fn trap_exit(&mut self, trap_exit: bool)
pub async fn trap_exit(&mut self, trap_exit: bool)
Set whether this actor upon receiving a Signal will be able to
handle it (trap_exit = true) or crash (trap_exit = false).
pub async fn spawn_job<F>(&mut self, fut: F)
Source§impl<M> Context<M>
“data-bag” related methods
impl<M> Context<M>
“data-bag” related methods
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for Context<M>
impl<M> !RefUnwindSafe for Context<M>
impl<M> Send for Context<M>where
M: Send,
impl<M> Sync for Context<M>where
M: Send,
impl<M> Unpin for Context<M>
impl<M> !UnwindSafe for Context<M>
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