Trait bevy_reflect::prelude::Reflect [−][src]
A reflected rust type.
Safety
Implementors must ensure that Reflect::any and Reflect::any_mut both return the self
value passed in
If this is not done, [Reflect::downcast] will be UB (and also just logically broken).
Required methods
fn type_name(&self) -> &str
[src]
fn any(&self) -> &dyn Any
[src]
fn any_mut(&mut self) -> &mut dyn Any
[src]
fn apply(&mut self, value: &dyn Reflect)
[src]
fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
[src]
fn reflect_ref(&self) -> ReflectRef<'_>
[src]
fn reflect_mut(&mut self) -> ReflectMut<'_>
[src]
fn clone_value(&self) -> Box<dyn Reflect>
[src]
fn reflect_hash(&self) -> Option<u64>
[src]
Returns a hash of the value (which includes the type) if hashing is supported. Otherwise
None
will be returned.
fn reflect_partial_eq(&self, _value: &dyn Reflect) -> Option<bool>
[src]
Returns a “partial equal” comparison result if comparison is supported. Otherwise None
will be returned.
fn serializable(&self) -> Option<Serializable<'_>>
[src]
Returns a serializable value, if serialization is supported. Otherwise None
will be
returned.
Implementations
impl dyn Reflect
[src]
pub fn downcast<T: Reflect>(
self: Box<dyn Reflect>
) -> Result<Box<T>, Box<dyn Reflect>>
[src]
self: Box<dyn Reflect>
) -> Result<Box<T>, Box<dyn Reflect>>
pub fn take<T: Reflect>(self: Box<dyn Reflect>) -> Result<T, Box<dyn Reflect>>
[src]
pub fn is<T: Reflect>(&self) -> bool
[src]
pub fn downcast_ref<T: Reflect>(&self) -> Option<&T>
[src]
pub fn downcast_mut<T: Reflect>(&mut self) -> Option<&mut T>
[src]
Trait Implementations
impl Debug for dyn Reflect
[src]
impl GetPath for dyn Reflect
[src]
fn path<'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r dyn Reflect, ReflectPathError<'p>>
[src]
&'r self,
path: &'p str
) -> Result<&'r dyn Reflect, ReflectPathError<'p>>
fn path_mut<'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut dyn Reflect, ReflectPathError<'p>>
[src]
&'r mut self,
path: &'p str
) -> Result<&'r mut dyn Reflect, ReflectPathError<'p>>
fn get_path<'r, 'p, T: Reflect>(
&'r self,
path: &'p str
) -> Result<&'r T, ReflectPathError<'p>>
[src]
&'r self,
path: &'p str
) -> Result<&'r T, ReflectPathError<'p>>
fn get_path_mut<'r, 'p, T: Reflect>(
&'r mut self,
path: &'p str
) -> Result<&'r mut T, ReflectPathError<'p>>
[src]
&'r mut self,
path: &'p str
) -> Result<&'r mut T, ReflectPathError<'p>>