[go: up one dir, main page]

Recipient

Trait Recipient 

Source
pub trait Recipient {
    // Required methods
    fn next(&self) -> Option<ChildRef>;
    fn all(&self) -> Vec<ChildRef>;
    fn register(&self, actor: ChildRef);
    fn remove(&self, actor: &ChildRef);
}
Expand description

A Recipient is responsible for maintaining it’s list of recipients, and deciding which child gets to receive which message.

Required Methods§

Source

fn next(&self) -> Option<ChildRef>

Provide this function to declare which recipient will receive the next message

Source

fn all(&self) -> Vec<ChildRef>

Return all recipients that will receive a broadcast message

Source

fn register(&self, actor: ChildRef)

Add this actor to your list of recipients

Source

fn remove(&self, actor: &ChildRef)

Remove this actor from your list of recipients

Implementors§