Skip to main content

Placement

Trait Placement 

Source
pub trait Placement: Send + Sync {
    // Required method
    fn route(
        &self,
        to: &Address,
        virtual_actor: bool,
        env: Option<&Envelope>,
    ) -> Route;
}
Expand description

Decides where virtual actors and stateless workers live in a cluster.

Required Methods§

Source

fn route( &self, to: &Address, virtual_actor: bool, env: Option<&Envelope>, ) -> Route

Where the actor at to lives, for delivering env (None when the node asks before activating to, with no message in hand). virtual_actor is true when this node knows to as a virtual actor (its chart type is registered or it has a journal here); the node also asks for stateless workers and for addresses it does not know, which a cluster may host elsewhere. Route::Local for an address the node does not know sends it on to the directory.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§