ReflectEvent

Enum ReflectEvent 

Source
#[non_exhaustive]
pub enum ReflectEvent { VecInserted { path: Option<String>, index: usize, }, VecRemoved { path: Option<String>, index: usize, }, VecReordered { path: Option<String>, from: usize, to: usize, }, VecCleared { path: Option<String>, previous_len: usize, }, ArrayReordered { path: Option<String>, from: usize, to: usize, }, MapInserted { path: Option<String>, key: String, }, MapRemoved { path: Option<String>, key: String, }, MapRenamed { path: Option<String>, from: String, to: String, }, MapCleared { path: Option<String>, previous_len: usize, }, }
Expand description

A single structural change observed while rendering reflected UI.

These events focus on container structure (insert/remove/reorder/rename) rather than low-level pointer or interaction details, providing a simplified analogue to ImReflect’s richer ImResponse type.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

VecInserted

A vector had an element inserted at the given index.

Fields

§path: Option<String>

Logical field path associated with the vector, if known.

§index: usize

Index where the new element was inserted.

§

VecRemoved

A vector element was removed from the given index.

Fields

§path: Option<String>

Logical field path associated with the vector, if known.

§index: usize

Index from which the element was removed.

§

VecReordered

A vector element was moved from from to to (indices in the final layout).

Fields

§path: Option<String>

Logical field path associated with the vector, if known.

§from: usize

Original index of the moved element.

§to: usize

Final index of the moved element after reordering.

§

VecCleared

All elements were removed from a vector that previously contained previous_len items.

Fields

§path: Option<String>

Logical field path associated with the vector, if known.

§previous_len: usize

Number of elements that were present before the clear operation.

§

ArrayReordered

A fixed-size array had two elements swapped.

Fields

§path: Option<String>

Logical field path associated with the array, if known.

§from: usize

First index in the swap operation.

§to: usize

Second index in the swap operation.

§

MapInserted

A map entry with the given key was inserted.

Fields

§path: Option<String>

Logical field path associated with the map, if known.

§key: String

Key for the newly inserted entry.

§

MapRemoved

A map entry with the given key was removed.

Fields

§path: Option<String>

Logical field path associated with the map, if known.

§key: String

Key for the removed entry.

§

MapRenamed

A map entry key was renamed from from to to.

Fields

§path: Option<String>

Logical field path associated with the map, if known.

§from: String

Original key of the entry.

§to: String

New key assigned to the entry.

§

MapCleared

All entries were removed from a map that previously contained previous_len items.

Fields

§path: Option<String>

Logical field path associated with the map, if known.

§previous_len: usize

Number of entries that were present before the clear operation.

Trait Implementations§

Source§

impl Clone for ReflectEvent

Source§

fn clone(&self) -> ReflectEvent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReflectEvent

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more