pub struct Broker<T>{ /* private fields */ }Implementations§
Trait Implementations§
Source§impl<T> Actor for Broker<T>
impl<T> Actor for Broker<T>
Source§fn started<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn started<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Called as soon as the actor has been started.
Source§fn stopping<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<Self>,
) -> Pin<Box<dyn Future<Output = KeepRunning> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn stopping<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<Self>,
) -> Pin<Box<dyn Future<Output = KeepRunning> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Called when the actor calls the
Context::stop. This method
can prevent the actor from stopping by returning KeepRunning::Yes.
If this method returns KeepRunning::StopSelf,
this actor will be stopped. If it returns
KeepRunning::StopAll, then all actors on the same
address as this actor will be stopped. This can take a little bit of time to propagate. Read moreSource§fn stopped<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn stopped<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Called when the actor is in the process of stopping. This could be because
KeepRunning::StopAll or
KeepRunning::StopSelf was returned from the
Actor::stopping method, or because there are no more
strong addresses (Address, as opposed to
WeakAddress. This should be used for any final cleanup before
the actor is dropped.Source§fn create(self, message_cap: Option<usize>) -> ActorManager<Self>
fn create(self, message_cap: Option<usize>) -> ActorManager<Self>
Returns the actor’s address and manager in a ready-to-start state, given the cap for the
actor’s mailbox. If
None is passed, it will be of unbounded size. To spawn the actor,
the ActorManager::spawn must be called, or
the ActorManager::run method must be called
and the future it returns spawned onto an executor. Read moreAuto Trait Implementations§
impl<T> Freeze for Broker<T>
impl<T> !RefUnwindSafe for Broker<T>
impl<T> Send for Broker<T>
impl<T> Sync for Broker<T>
impl<T> Unpin for Broker<T>
impl<T> !UnwindSafe for Broker<T>
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