[][src]Trait kay::TypedID

pub trait TypedID: Copy + Clone + Sized + Debug + Hash {
    type Target: ActorOrActorTrait;
    fn as_raw(&self) -> RawID;
fn from_raw(raw: RawID) -> Self; fn as_raw_string(&self) -> String { ... }
fn from_raw_str(raw_str: &str) -> Result<Self, ParseRawIDError> { ... }
fn local_first(world: &mut World) -> Self { ... }
fn global_first(world: &mut World) -> Self { ... }
fn local_broadcast(world: &mut World) -> Self { ... }
fn global_broadcast(world: &mut World) -> Self { ... } }

Wraps a RawID, bringing type information regarding the referenced actor class or trait to compile time, for type safe handling of ids.

Associated Types

type Target: ActorOrActorTrait

The actor class or actor trait referenced by this ID type.

Loading content...

Required methods

fn as_raw(&self) -> RawID

Get the wrapped RawID

fn from_raw(raw: RawID) -> Self

Create a TypedID based on a RawID. Note: this should only be done when you are sure that the RawID actually points at the correct actor class or trait at runtime

Loading content...

Provided methods

fn as_raw_string(&self) -> String

Get the canonical string representation of the wrapped RawID

fn from_raw_str(raw_str: &str) -> Result<Self, ParseRawIDError>

Create a TypedID based on the canoncial string representation of a RawID. Note: this should only be done when you are sure that the RawID actually points at the correct actor class or trait at runtime

fn local_first(world: &mut World) -> Self

Get the local first actor instance of type Target

fn global_first(world: &mut World) -> Self

Get the global first actor instance of type Target

fn local_broadcast(world: &mut World) -> Self

Get an ID representing a local broadcast to actors of type Target

fn global_broadcast(world: &mut World) -> Self

Get an ID representing a global broadcast to actors of type Target

Loading content...

Implementors

Loading content...