FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ChangeAwareList

    struct · ferroui-dynamic-data · v0.5.0

    struct ChangeAwareList<T>
    

    A list that records its changes until they are captured (ChangeAwareList<T>), batching consecutive insertions and removals into ranges as upstream does.

    View source

    Members

    new

    fn new() -> Self
    

    An empty list (ChangeAwareList(int capacity = -1)).

    Source

    with_capacity

    fn with_capacity(capacity: usize) -> Self
    

    An empty list with room for capacity items.

    Source

    from_items

    fn from_items(items: Vec<T>) -> Self
    

    A list of the items, whose first change adds them (ChangeAwareList(IEnumerable<T>)).

    Source

    from_list

    fn from_list(list: &ChangeAwareList<T>, copy_changes: bool) -> Self
    

    A copy of list, with its changes or without (ChangeAwareList(ChangeAwareList<T>, bool)).

    Source

    count

    fn count(self: &Self) -> usize
    

    The number of items (Count).

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Source

    items

    fn items(self: &Self) -> &[T]
    

    The items.

    Source

    get

    fn get(self: &Self, index: usize) -> &T
    

    The item at index (the indexer's getter).

    Source

    set

    fn set(self: &mut Self, index: usize, item: T)
    

    Replaces the item at index (the indexer's setter, SetItem).

    Source

    add

    fn add(self: &mut Self, item: T)
    

    Adds an item at the end (Add).

    Source

    capture_changes

    fn capture_changes(self: &mut Self) -> ChangeSet<T>
    

    The changes since the last capture, and a clean slate (CaptureChanges): removals that emptied the list are reported as one Clear.

    Source

    clear

    fn clear(self: &mut Self)
    

    Removes every item (Clear).

    Source

    contains

    fn contains(self: &Self, item: &T) -> bool
    

    Whether the list has item (Contains).

    Source

    index_of

    fn index_of(self: &Self, item: &T) -> Option<usize>
    

    The index of item (IndexOf).

    Source

    index_of_with

    fn index_of_with(self: &Self, item: &T, comparer: &dyn Fn(&T, &T) -> bool) -> Option<usize>
    

    The index of item by comparer (IndexOf(T, IEqualityComparer<T>)).

    Source

    insert

    fn insert(self: &mut Self, index: usize, item: T)
    

    Inserts an item (Insert).

    Panics

    When index is beyond the end (ArgumentException).

    Source

    move_item

    fn move_item(self: &mut Self, item: &T, destination: usize)
    

    Moves item to destination (Move(T, int)).

    Source

    refresh_with

    fn refresh_with(self: &mut Self, item: T, index: usize)
    

    Replaces the item at index with item and reports a refresh (Refresh(T, int)).

    Source

    refresh

    fn refresh(self: &mut Self, item: &T) -> bool
    

    Reports a refresh of item; false when it is not in the list (Refresh(T)).

    Source

    refresh_at

    fn refresh_at(self: &mut Self, index: usize)
    

    Reports a refresh of the item at index (RefreshAt).

    Source

    remove

    fn remove(self: &mut Self, item: &T) -> bool
    

    Removes item; false when it is not in the list (Remove(T)).

    Source

    remove_at

    fn remove_at(self: &mut Self, index: usize)
    

    Removes the item at index (RemoveAt).

    Source

    add_range

    fn add_range(self: &mut Self, items: Vec<T>)
    

    Adds the items at the end (AddRange).

    Source

    remove_range

    fn remove_range(self: &mut Self, index: usize, count: usize)
    

    Removes count items from index (RemoveRange).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • Default
    • IExtendedList<T>
    • IList<T>

    Availability

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