Trait kay::Actor[][src]

pub trait Actor: Compact + StorageAware + 'static {
    type ID: TypedID;
    fn id(&self) -> Self::ID;
unsafe fn set_id(&mut self, id: RawID); fn id_as<TargetID: TraitIDFrom<Self>>(&self) -> TargetID { ... }
fn local_first(world: &mut World) -> Self::ID { ... }
fn global_first(world: &mut World) -> Self::ID { ... }
fn local_broadcast(world: &mut World) -> Self::ID { ... }
fn global_broadcast(world: &mut World) -> Self::ID { ... } }

Trait that Actors instance have to implement for a Swarm so their internally stored instance RawID can be gotten and set.

Furthermore, an Actor has to implement Compact, so a Swarm can compactly store each Actor's potentially dynamically-sized state.

This trait can is auto-derived when using the kay_codegen build script.

Associated Types

The unique TypedID of this actor

Required Methods

Get TypedID of this actor

Set the full RawID (Actor type id + instance id) of this actor (only used internally by Swarm)

Provided Methods

Get the id of this actor as an actor trait TypedID (available if the actor implements the corresponding trait)

Get the TypedID of the local first actor of this kind

Get the TypedID of the global first actor of this kind

Get the TypedID representing a local broadcast to actors of this type

Get the TypedID representing a global broadcast to actors of this type

Implementors