Change
struct · ferroui-dynamic-data · v0.5.0
struct Change<T>
A change of a list (Change<T>): of one item, or of a range of items.
Upstream's change of one item has an empty range (RangeChange<T>.Empty), and a change of a
range has an empty item (ItemChange<T>.Empty, whose item is the default value of T); here
range is empty for the change of an item, and the change of a range has no
item (try_item).
Members
new
fn new(reason: ListChangeReason, current: T, index: Option<usize>) -> Self
The change of one item (Change(ListChangeReason, T, int index = -1)).
range_change
fn range_change(reason: ListChangeReason, items: Vec<T>, index: Option<usize>) -> Self
The change of a range (Change(ListChangeReason, IEnumerable<T>, int index = -1)).
Panics
For a reason of one item (IndexOutOfRangeException).
moved
fn moved(current: T, current_index: usize, previous_index: usize) -> Self
A move (Change(T, int currentIndex, int previousIndex)).
with_previous
fn with_previous(reason: ListChangeReason, current: T, previous: Option<T>, current_index: Option<usize>, previous_index: Option<usize>) -> Self
The change of one item with every part (Change(ListChangeReason, T, in Optional<T>, int, int)).
Panics
For Add with a previous item, Replace without one, and Refresh without an index
(ArgumentException).
reason
fn reason(self: &Self) -> ListChangeReason
The reason (Reason).
change_type
fn change_type(self: &Self) -> ChangeType
Whether the change is of an item or of a range (Type).
item
fn item(self: &Self) -> &ItemChange<T>
The change of the item (Item).
Panics
For the change of a range, whose item upstream is empty.
try_item
fn try_item(self: &Self) -> Option<&ItemChange<T>>
The change of the item, None for the change of a range.
range
fn range(self: &Self) -> &RangeChange<T>
The range (Range): empty for the change of an item.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedEquivalent<K>CloneStructuralPartialEqPartialEqEqHashDebugFromIterator<Change<T>>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.