pub struct Canon { /* private fields */ }
Expand description
Contains the canon names of entities.
Implementations
sourceimpl Canon
impl Canon
sourcepub fn get_id(&self, name: &EntityName) -> Option<Entity>
pub fn get_id(&self, name: &EntityName) -> Option<Entity>
Returns the Entity
ID associated with the given EntityName
.
sourcepub fn get_name(&self, entity: Entity) -> Option<EntityName>
pub fn get_name(&self, entity: Entity) -> Option<EntityName>
Returns the EntityName
associated with the given Entity
ID.
sourcepub fn canonize_name(&self, name: &EntityName) -> Entity
pub fn canonize_name(&self, name: &EntityName) -> Entity
Canonizes a given EntityName
and returns the associated Entity
ID.
sourcepub fn canonize_id(&self, entity: Entity) -> EntityName
pub fn canonize_id(&self, entity: Entity) -> EntityName
Canonizes a given Entity
ID and returns the associated EntityName
.
Trait Implementations
sourceimpl CustomEntitySerializer for Canon
impl CustomEntitySerializer for Canon
type SerializedID = Uuid
type SerializedID = Uuid
The type used for serialized Entity IDs.
sourcefn to_serialized(&self, entity: Entity) -> Self::SerializedID
fn to_serialized(&self, entity: Entity) -> Self::SerializedID
Constructs the serializable representation of Entity
sourcefn from_serialized(&self, serialized: Self::SerializedID) -> Entity
fn from_serialized(&self, serialized: Self::SerializedID) -> Entity
Convert a SerializedEntity
to an Entity
.
Auto Trait Implementations
impl !RefUnwindSafe for Canon
impl Send for Canon
impl Sync for Canon
impl Unpin for Canon
impl UnwindSafe for Canon
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcepub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcepub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcepub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcepub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more