Struct thespis_impl::Mailbox [−][src]
pub struct Mailbox<A> where
A: Actor, { /* fields omitted */ }
Expand description
The mailbox implementation.
Implementations
Create a new inbox.
Create an Addr
to send messages to this mailbox.
Run the mailbox. Returns a future that processes incoming messages. If the actor panics during message processing, this will return the mailbox to you so you can supervise actors by re-initiating your actor and then calling this method on the mailbox again. All addresses will remain valid in this scenario.
This means that we use AssertUnwindSafe
and
catch_unwind
when calling your actor
and the thread will not unwind. This means that your actor should implement
std::panic::UnwindSafe
. This might become an enforced trait bound for Actor
in
the future.
Warning: if you drop the future returned by this function in order to stop an actor,
Actor::stopped
will not be called.
Exactly as Mailbox::start
, but works for !Send
actors.
Trait Implementations
Auto Trait Implementations
impl<A> !RefUnwindSafe for Mailbox<A>
impl<A> !UnwindSafe for Mailbox<A>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more