pub struct Executor<A> { /* private fields */ }
Expand description
The event loop for an actor
Handles the receipt of messages, and state management of the actor. The primary method exposed
by the executor is Executor::run
, which is used to execute the event loop.
§Example
A common pattern is to spawn the executor onto an async runtime like tokio.
let my_actor = MyActor;
let (executor, addr) = Executor::new(my_actor);
tokio::spawn(executor.run());
Implementations§
Auto Trait Implementations§
impl<A> Freeze for Executor<A>where
A: Freeze,
impl<A> RefUnwindSafe for Executor<A>where
A: RefUnwindSafe,
impl<A> Send for Executor<A>where
A: Send,
impl<A> Sync for Executor<A>where
A: Sync,
impl<A> !Unpin for Executor<A>
impl<A> UnwindSafe for Executor<A>where
A: UnwindSafe,
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