Trait ActorMesh

Source
pub trait ActorMesh: Mesh<Id = ActorMeshId> {
    type Actor: RemoteActor;

    // Required methods
    fn proc_mesh(&self) -> &ProcMesh;
    fn name(&self) -> &str;

    // Provided methods
    fn cast<M>(
        &self,
        sender: &impl CanSend,
        selection: Selection,
        message: M,
    ) -> Result<(), CastError>
       where Self::Actor: RemoteHandles<IndexedErasedUnbound<M>>,
             M: Castable + RemoteMessage { ... }
    fn world_id(&self) -> &WorldId { ... }
    fn iter_actor_refs(&self) -> impl Iterator<Item = ActorRef<Self::Actor>> { ... }
    fn stop<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn bind(&self) -> ActorMeshRef<Self::Actor> { ... }
}
Expand description

A mesh of actors, all of which reside on the same ProcMesh.

Required Associated Types§

Source

type Actor: RemoteActor

The type of actor in the mesh.

Required Methods§

Source

fn proc_mesh(&self) -> &ProcMesh

The ProcMesh on top of which this actor mesh is spawned.

Source

fn name(&self) -> &str

The name given to the actors in this mesh.

Provided Methods§

Source

fn cast<M>( &self, sender: &impl CanSend, selection: Selection, message: M, ) -> Result<(), CastError>

Cast an M-typed message to the ranks selected by sel in this ActorMesh.

Source

fn world_id(&self) -> &WorldId

Source

fn iter_actor_refs(&self) -> impl Iterator<Item = ActorRef<Self::Actor>>

Iterate over all ActorRef<Self::Actor> in this mesh.

Source

fn stop<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn bind(&self) -> ActorMeshRef<Self::Actor>

Get a serializeable reference to this mesh similar to ActorHandle::bind

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.

Implementors§