Struct agner_actors::Context
source · [−]pub struct Context<M> { /* private fields */ }Expand description
Actor’s API to itself
Implementations
sourceimpl<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.
sourceimpl<M> Context<M>
impl<M> Context<M>
pub fn init_ack(&mut self, actor_id: Option<ActorID>) -> bool
👎Deprecated since 0.3.2
pub fn init_ack_ok(&mut self, actor_id: Option<ActorID>) -> bool
pub fn init_ack_err(&mut self, exit_reason: Exit) -> bool
pub async fn exit(&mut self, exit_reason: Exit) -> Never
pub async fn link(&mut self, to: ActorID)
pub async fn unlink(&mut self, from: ActorID)
pub async fn trap_exit(&mut self, trap_exit: bool)
pub async fn future_to_inbox<F>(&mut self, fut: F)where
F: Future + Send + Sync + 'static,
F::Output: Into<M>,
Trait Implementations
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more