[][src]Trait kay::Actor

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 { ... } }

Must be implemented by every struct to be used as actor instance state

Associated Types

type ID: TypedID

The TypedID used to refer to instances of this actor class

Loading content...

Required methods

fn id(&self) -> Self::ID

Get the ID referring to this actor instace

unsafe fn set_id(&mut self, id: RawID)

Set the ID of this actor instance - only to be used by the system itself

Loading content...

Provided methods

fn id_as<TargetID: TraitIDFrom<Self>>(&self) -> TargetID

Convert the ID of this instance into an actor trait ID. Only works if the actor implements the corresponding actor trait

Loading content...

Implementors

Loading content...