[][src]Trait bevy_reflect::Reflect

pub trait Reflect: Any + Send + Sync {
    pub fn type_name(&self) -> &str;
pub fn any(&self) -> &dyn Any;
pub fn any_mut(&mut self) -> &mut dyn Any;
pub fn apply(&mut self, value: &dyn Reflect);
pub fn set(
        &mut self,
        value: Box<dyn Reflect>
    ) -> Result<(), Box<dyn Reflect>>;
pub fn reflect_ref(&self) -> ReflectRef<'_>;
pub fn reflect_mut(&mut self) -> ReflectMut<'_>;
pub fn clone_value(&self) -> Box<dyn Reflect>;
pub fn reflect_hash(&self) -> Option<u64>;
pub fn reflect_partial_eq(&self, _value: &dyn Reflect) -> Option<bool>;
pub fn serializable(&self) -> Option<Serializable<'_>>; }

A reflected rust type.

Required methods

pub fn type_name(&self) -> &str[src]

pub fn any(&self) -> &dyn Any[src]

pub fn any_mut(&mut self) -> &mut dyn Any[src]

pub fn apply(&mut self, value: &dyn Reflect)[src]

pub fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>[src]

pub fn reflect_ref(&self) -> ReflectRef<'_>[src]

pub fn reflect_mut(&mut self) -> ReflectMut<'_>[src]

pub fn clone_value(&self) -> Box<dyn Reflect>[src]

pub 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.

pub 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.

pub fn serializable(&self) -> Option<Serializable<'_>>[src]

Returns a serializable value, if serialization is supported. Otherwise None will be returned.

Loading content...

Implementations

impl dyn Reflect[src]

pub fn downcast<T: Reflect>(
    self: Box<dyn Reflect>
) -> Result<Box<T>, Box<dyn Reflect>>
[src]

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]

Implementations on Foreign Types

impl Reflect for bool[src]

impl Reflect for u8[src]

impl Reflect for u16[src]

impl Reflect for u32[src]

impl Reflect for u64[src]

impl Reflect for u128[src]

impl Reflect for usize[src]

impl Reflect for i8[src]

impl Reflect for i16[src]

impl Reflect for i32[src]

impl Reflect for i64[src]

impl Reflect for i128[src]

impl Reflect for isize[src]

impl Reflect for f32[src]

impl Reflect for f64[src]

impl Reflect for String[src]

impl<T: Serialize + Clone + for<'de> Deserialize<'de> + Reflect + 'static> Reflect for Option<T>[src]

impl<T: Serialize + Hash + Eq + Clone + for<'de> Deserialize<'de> + Send + Sync + 'static> Reflect for HashSet<T>[src]

impl<T: Serialize + Clone + for<'de> Deserialize<'de> + Send + Sync + 'static> Reflect for Range<T>[src]

impl<T: Reflect> Reflect for Vec<T>[src]

impl<K: Reflect + Clone + Eq + Hash, V: Reflect + Clone> Reflect for HashMap<K, V>[src]

Loading content...

Implementors

impl Reflect for DynamicList[src]

impl Reflect for DynamicMap[src]

impl Reflect for DynamicStruct[src]

impl Reflect for DynamicTupleStruct[src]

Loading content...