pub struct SystemHandle { /* private fields */ }Expand description
Contains the “metadata” of the system, including information about the registry of actors currently existing within the system.
Implementations§
Source§impl SystemHandle
impl SystemHandle
Sourcepub fn shutdown(&self) -> Result<(), ActorError>
pub fn shutdown(&self) -> Result<(), ActorError>
Stops all actors spawned by this system.
Sourcepub fn subscribe_recipient<M: 'static, E: Event + Into<M>>(
&self,
recipient: Recipient<M>,
)
pub fn subscribe_recipient<M: 'static, E: Event + Into<M>>( &self, recipient: Recipient<M>, )
Subscribe given recipient to events of type E. See BareContext::subscribe().
Sourcepub fn subscribe_and_receive_latest<M: 'static, E: Event + Into<M>>(
&self,
recipient: Recipient<M>,
) -> Result<(), SendError>
pub fn subscribe_and_receive_latest<M: 'static, E: Event + Into<M>>( &self, recipient: Recipient<M>, ) -> Result<(), SendError>
Subscribe given recipient to events of type E and send the last cached event to it.
See BareContext::subscribe_and_receive_latest().
Sourcepub fn publish<E: Event>(&self, event: E) -> Result<(), PublishError>
pub fn publish<E: Event>(&self, event: E) -> Result<(), PublishError>
Publish an event. All actors that have previously subscribed to the type will receive it.
The event will be also cached. Actors that will subscribe to the type in future may choose to receive the last cached event upon subscription.
When sending to some subscriber fails, others are still tried and vec of errors is returned.
For direct, non-Clone or high-throughput messages please use Addr or Recipient.
pub fn name(&self) -> &str
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Return true if the actor system is running (not shutting down, not stopped).
Trait Implementations§
Source§impl Clone for SystemHandle
impl Clone for SystemHandle
Source§fn clone(&self) -> SystemHandle
fn clone(&self) -> SystemHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more