pub struct XvcEntity(/* private fields */);
Expand description
Describes an entity in Entity Component System-sense.
It doesn’t have any semantics except being unique for a given entity. Various types of information (components) can be attached to this entity. XvcStore uses the entity as a key for the components.
It’s possible to convert to (u64, u64)
or u128
back and forth.
Normally, you should use XvcEntityGenerator to create entities.
It randomizes the first value to be unique and saves the last number across sessions.
This changed in 0.5. See https://github.com/iesahin/xvc/issues/198
Trait Implementations§
Source§impl<'de> Deserialize<'de> for XvcEntity
impl<'de> Deserialize<'de> for XvcEntity
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<XvcEntity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<XvcEntity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, U> From<ChildEntity<T, U>> for XvcEntity
impl<T, U> From<ChildEntity<T, U>> for XvcEntity
Source§fn from(r1ne: ChildEntity<T, U>) -> XvcEntity
fn from(r1ne: ChildEntity<T, U>) -> XvcEntity
Converts to this type from the input type.
Source§impl Ord for XvcEntity
impl Ord for XvcEntity
Source§impl PartialOrd for XvcEntity
impl PartialOrd for XvcEntity
Source§impl Serialize for XvcEntity
impl Serialize for XvcEntity
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for XvcEntity
impl Eq for XvcEntity
impl StructuralPartialEq for XvcEntity
Auto Trait Implementations§
impl Freeze for XvcEntity
impl RefUnwindSafe for XvcEntity
impl Send for XvcEntity
impl Sync for XvcEntity
impl Unpin for XvcEntity
impl UnwindSafe for XvcEntity
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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