Trait kay::TypedID [−][src]
pub trait TypedID: Copy + Clone + Sized + Debug + Hash { 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> { ... } }
TypedID
is a construct on top of a RawID
that can refer
to a specific kind of actor, or actor trait at compile time
Required Methods
fn as_raw(&self) -> RawID
Get the underlying RawID
fn from_raw(raw: RawID) -> Self
Construct a new TypedID
from a RawID
- this implies knowledge
about the type of actor referenced by the RawID
Provided Methods
fn as_raw_string(&self) -> String
Get the underlying RawID
as a string
fn from_raw_str(raw_str: &str) -> Result<Self, ParseRawIDError>
Construct a new TypedID
from a RawID
in string form - this implies knowledge
about the type of actor referenced by the RawID