FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

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

    View source

    Members

    new

    fn new(reason: ListChangeReason, current: T, index: Option<usize>) -> Self
    

    The change of one item (Change(ListChangeReason, T, int index = -1)).

    Source

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

    Source

    moved

    fn moved(current: T, current_index: usize, previous_index: usize) -> Self
    

    A move (Change(T, int currentIndex, int previousIndex)).

    Source

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

    Source

    reason

    fn reason(self: &Self) -> ListChangeReason
    

    The reason (Reason).

    Source

    change_type

    fn change_type(self: &Self) -> ChangeType
    

    Whether the change is of an item or of a range (Type).

    Source

    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.

    Source

    try_item

    fn try_item(self: &Self) -> Option<&ItemChange<T>>
    

    The change of the item, None for the change of a range.

    Source

    range

    fn range(self: &Self) -> &RangeChange<T>
    

    The range (Range): empty for the change of an item.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • Equivalent<K>
    • Clone
    • StructuralPartialEq
    • PartialEq
    • Eq
    • Hash
    • Debug
    • FromIterator<Change<T>>

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.