pub trait AddrSignalExt {
    // Required methods
    fn stop(&self);
    fn terminate(&self);
}
Expand description

An extension trait for Addrs that provides convenient methods to control associated actors’ lifecycle.

The actor must implement the SignalHandler trait for these methods to work.

§Delayed operation

These methods are different from their context counterparts which have immediate effects. Instead, they are queued to the mailbox, subjecting to message sending and handling delays. Moreover, if the actor stops/terminates/panics before handling the signal, no actual operation will be performed.

§Signal convention

There’s no guarantee how the actor may react to signals. A misbehaved actor may act completely different from your intention.

See signals module for details.

Required Methods§

source

fn stop(&self)

Stop the actor associated with the address.

This method should have the same effect as ActorContext::stop.

source

fn terminate(&self)

Terminate the actor associated with the address.

This method should have the same effect as ActorContext::terminate.

Implementations on Foreign Types§

source§

impl<A> AddrSignalExt for Addr<A>

source§

fn stop(&self)

source§

fn terminate(&self)

Implementors§