pub struct Canon { /* private fields */ }
Expand description
Contains the canon names of entities.
Implementations§
Source§impl Canon
impl Canon
Sourcepub fn get_id(&self, name: &[u8; 16]) -> Option<Entity>
pub fn get_id(&self, name: &[u8; 16]) -> Option<Entity>
Returns the Entity
ID associated with the given EntityName
.
Sourcepub fn get_name(&self, entity: Entity) -> Option<[u8; 16]>
pub fn get_name(&self, entity: Entity) -> Option<[u8; 16]>
Returns the EntityName
associated with the given Entity
ID.
Sourcepub fn canonize_name(&self, name: &[u8; 16]) -> Entity
pub fn canonize_name(&self, name: &[u8; 16]) -> Entity
Canonizes a given EntityName
and returns the associated Entity
ID.
Sourcepub fn canonize_id(&self, entity: Entity) -> [u8; 16]
pub fn canonize_id(&self, entity: Entity) -> [u8; 16]
Canonizes a given Entity
ID and returns the associated EntityName
.
Trait Implementations§
Source§impl CustomEntitySerializer for Canon
impl CustomEntitySerializer for Canon
Source§type SerializedID = Uuid
type SerializedID = Uuid
The type used for serialized Entity IDs.
Source§fn to_serialized(
&self,
entity: Entity,
) -> <Canon as CustomEntitySerializer>::SerializedID
fn to_serialized( &self, entity: Entity, ) -> <Canon as CustomEntitySerializer>::SerializedID
Constructs the serializable representation of
Entity
Source§fn from_serialized(
&self,
serialized: <Canon as CustomEntitySerializer>::SerializedID,
) -> Entity
fn from_serialized( &self, serialized: <Canon as CustomEntitySerializer>::SerializedID, ) -> Entity
Convert a
SerializedEntity
to an Entity
.Auto Trait Implementations§
impl !Freeze for Canon
impl !RefUnwindSafe for Canon
impl Send for Canon
impl Sync for Canon
impl Unpin for Canon
impl UnwindSafe for Canon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Component for T
impl<T> Component for T
Source§type Storage = PackedStorage<T>
type Storage = PackedStorage<T>
The storage type required to hold all instances of this component in a world.
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
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.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> EntitySerializer for Twhere
T: CustomEntitySerializer + 'static,
impl<T> EntitySerializer for Twhere
T: CustomEntitySerializer + 'static,
Source§fn serialize(
&self,
entity: Entity,
serialize_fn: &mut dyn FnMut(&dyn Serialize),
)
fn serialize( &self, entity: Entity, serialize_fn: &mut dyn FnMut(&dyn Serialize), )
Serializes an
Entity
by constructing the serializable representation
and passing it into serialize_fn
.Source§fn deserialize(
&self,
deserializer: &mut dyn Deserializer<'_>,
) -> Result<Entity, Error>
fn deserialize( &self, deserializer: &mut dyn Deserializer<'_>, ) -> Result<Entity, Error>
Deserializes an
Entity
.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more