ActorAddress

Trait ActorAddress 

Source
pub trait ActorAddress<M> {
    // Required methods
    fn try_notify(&self, message: M) -> Result<(), M>;
    async fn notify(&self, message: M);
}
Expand description

A trait send message to another actor.

Individual actor implementations may augment the ActorAddress object when appropriate bounds are met to provide method-like invocations.

Required Methods§

Source

fn try_notify(&self, message: M) -> Result<(), M>

Attempt to send a message to the actor behind this address. If an error occurs when enqueueing the message on the destination actor, the message is returned.

Source

async fn notify(&self, message: M)

Attempt to deliver a message until successful.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<M> ActorAddress<M> for DynamicSender<'_, M>

Source§

fn try_notify(&self, message: M) -> Result<(), M>

Source§

async fn notify(&self, message: M)

Source§

impl<M, MUT, const N: usize> ActorAddress<M> for Sender<'_, MUT, M, N>
where MUT: RawMutex,

Source§

fn try_notify(&self, message: M) -> Result<(), M>

Source§

async fn notify(&self, message: M)

Implementors§