pub struct ComponentEntry { /* private fields */ }
Expand description
Represents a type erased component and value
Implementations§
Source§impl ComponentEntry
impl ComponentEntry
pub fn desc(&self) -> ComponentDesc
Sourcepub fn new<T: ComponentValue>(component: Component<T>, value: T) -> Self
pub fn new<T: ComponentValue>(component: Component<T>, value: T) -> Self
Creates a type erased component
Sourcepub fn from_raw_parts<T: ComponentValue>(desc: ComponentDesc, value: T) -> Self
pub fn from_raw_parts<T: ComponentValue>(desc: ComponentDesc, value: T) -> Self
Creates a type erased component
pub fn as_any(&self) -> &dyn Any
Sourcepub fn downcast_ref<T: 'static>(&self) -> &T
pub fn downcast_ref<T: 'static>(&self) -> &T
Sourcepub fn downcast_mut<T: 'static>(&mut self) -> &mut T
pub fn downcast_mut<T: 'static>(&mut self) -> &mut T
Sourcepub fn downcast_cloned<T: 'static>(&self) -> T
pub fn downcast_cloned<T: 'static>(&self) -> T
Sourcepub fn into_inner<T: 'static>(self) -> T
pub fn into_inner<T: 'static>(self) -> T
Sourcepub fn try_downcast_ref<T: 'static>(&self) -> Option<&T>
pub fn try_downcast_ref<T: 'static>(&self) -> Option<&T>
Attempt to downcast the value to type T
Sourcepub fn try_downcast_mut<T: 'static>(&mut self) -> Option<&mut T>
pub fn try_downcast_mut<T: 'static>(&mut self) -> Option<&mut T>
Attempt to downcast the value to type T
Sourcepub fn try_into_inner<T: 'static>(self) -> Option<T>
pub fn try_into_inner<T: 'static>(self) -> Option<T>
Take a concrete value out of the DynComponent.
pub fn try_downcast_cloned<T: 'static>(&self) -> Option<T>
pub fn as_debug(&self) -> &dyn Debug
Methods from Deref<Target = ComponentDesc>§
Sourcepub fn path_last(&self) -> String
pub fn path_last(&self) -> String
The last segment of the component path. Do not use this as a unique identifier; use Self::path instead.
Sourcepub fn name(&self) -> Option<String>
pub fn name(&self) -> Option<String>
A human-friendly name, if available. Corresponds to the Name attribute.
Sourcepub fn description(&self) -> Option<String>
pub fn description(&self) -> Option<String>
A human-friendly description, if available. Corresponds to the Description attribute.
pub fn type_name(&self) -> &'static str
pub fn type_id(&self) -> TypeId
pub fn has_attribute<A: ComponentAttribute>(&self) -> bool
pub fn attribute<A: ComponentAttribute>(&self) -> Option<AttributeGuard<A>>
pub fn attributes(&self) -> AttributeStoreGuard
pub fn attributes_mut(&self) -> AttributeStoreGuardMut
pub fn as_debug<'a>(&self, value: &'a dyn Any) -> &'a dyn Debug
pub fn index(&self) -> u32
pub fn from_json(&self, value: &str) -> Result<ComponentEntry, Error>
Sourcepub fn to_json(&self, value: &ComponentEntry) -> Result<String, Error>
pub fn to_json(&self, value: &ComponentEntry) -> Result<String, Error>
Converts the value to json
pub fn create_buffer(&self) -> Box<dyn IComponentBuffer>
Trait Implementations§
Source§impl Clone for ComponentEntry
impl Clone for ComponentEntry
Source§impl Debug for ComponentEntry
impl Debug for ComponentEntry
Source§impl Deref for ComponentEntry
impl Deref for ComponentEntry
Source§impl<'de> Deserialize<'de> for ComponentEntry
impl<'de> Deserialize<'de> for ComponentEntry
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Drop for ComponentEntry
impl Drop for ComponentEntry
Source§impl FromIterator<ComponentEntry> for Entity
impl FromIterator<ComponentEntry> for Entity
Source§fn from_iter<I: IntoIterator<Item = ComponentEntry>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = ComponentEntry>>(iter: I) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for ComponentEntry
impl RefUnwindSafe for ComponentEntry
impl Send for ComponentEntry
impl Sync for ComponentEntry
impl Unpin for ComponentEntry
impl UnwindSafe for ComponentEntry
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<T> ComponentValueBase for T
impl<T> ComponentValueBase for T
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> 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