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 Context::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 Context::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 is_running(&self) -> bool
Trait Implementations§
Source§impl Clone for SystemHandle
impl Clone for SystemHandle
Source§fn clone(&self) -> SystemHandle
fn clone(&self) -> SystemHandle
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for SystemHandle
impl Default for SystemHandle
Source§fn default() -> SystemHandle
fn default() -> SystemHandle
Auto Trait Implementations§
impl Freeze for SystemHandle
impl !RefUnwindSafe for SystemHandle
impl Send for SystemHandle
impl Sync for SystemHandle
impl Unpin for SystemHandle
impl !UnwindSafe for SystemHandle
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)