Enum ReflectMut

Source
pub enum ReflectMut<'a> {
    Struct(&'a mut dyn Struct),
    TupleStruct(&'a mut dyn TupleStruct),
    Tuple(&'a mut dyn Tuple),
    Enum(&'a mut dyn Enum),
    Array(&'a mut dyn Array),
    List(&'a mut dyn List),
    Map(&'a mut dyn Map),
    Scalar(ScalarMut<'a>),
    Opaque(&'a mut dyn Reflect),
}
Expand description

A mutable reflected value.

Constructed with Reflect::reflect_mut.

Variants§

§

Struct(&'a mut dyn Struct)

§

TupleStruct(&'a mut dyn TupleStruct)

§

Tuple(&'a mut dyn Tuple)

§

Enum(&'a mut dyn Enum)

§

Array(&'a mut dyn Array)

§

List(&'a mut dyn List)

§

Map(&'a mut dyn Map)

§

Scalar(ScalarMut<'a>)

§

Opaque(&'a mut dyn Reflect)

Not all Reflect implementations allow mutable access to the underlying value (such as core::num::NonZeroU8). This variant can be used for such types.

Implementations§

Source§

impl<'a> ReflectMut<'a>

Source

pub fn as_reflect_mut(&mut self) -> &mut dyn Reflect

Source

pub fn as_reflect(&self) -> &dyn Reflect

Source

pub fn as_tuple_mut(self) -> Option<&'a mut dyn Tuple>

Source

pub fn as_struct_mut(self) -> Option<&'a mut dyn Struct>

Source

pub fn as_tuple_struct_mut(self) -> Option<&'a mut dyn TupleStruct>

Source

pub fn as_enum_mut(self) -> Option<&'a mut dyn Enum>

Source

pub fn as_list_mut(self) -> Option<&'a mut dyn List>

Source

pub fn as_array_mut(self) -> Option<&'a mut dyn Array>

Source

pub fn as_map_mut(self) -> Option<&'a mut dyn Map>

Source

pub fn as_scalar_mut(self) -> Option<ScalarMut<'a>>

Source

pub fn as_opaque_mut(self) -> Option<&'a mut dyn Reflect>

Trait Implementations§

Source§

impl<'a> Debug for ReflectMut<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ReflectMut<'a>

§

impl<'a> !RefUnwindSafe for ReflectMut<'a>

§

impl<'a> Send for ReflectMut<'a>

§

impl<'a> !Sync for ReflectMut<'a>

§

impl<'a> Unpin for ReflectMut<'a>

§

impl<'a> !UnwindSafe for ReflectMut<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.