FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SourceListEditConvenienceEx

    trait · ferroui-dynamic-data · v0.5.0

    trait SourceListEditConvenienceEx<T: Clone + PartialEq + 'static>: ISourceList<T>
    

    The edit conveniences of source lists (SourceListEditConvenienceEx), implemented for every source list.

    View source

    Members

    add

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

    Adds item (Add).

    Source

    add_range

    fn add_range(self: &Self, items: impl IntoIterator<Item = T>)
    

    Adds the items (AddRange).

    Source

    clear

    fn clear(self: &Self)
    

    Removes every item (Clear).

    Source

    edit_diff

    fn edit_diff(self: &Self, all_items: impl IntoIterator<Item = T>)
    

    Makes the list hold all_items with the fewest changes, items compared by PartialEq (EditDiff(IEnumerable<T>, IEqualityComparer<T>? = null)).

    Source

    edit_diff_with_comparer

    fn edit_diff_with_comparer(self: &Self, all_items: impl IntoIterator<Item = T>, equality_comparer: impl Fn(&T, &T) -> bool)
    

    edit_diff with the equality of equality_comparer (EditDiff(IEnumerable<T>, IEqualityComparer<T>)).

    Source

    insert

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

    Inserts item at index (Insert).

    Source

    insert_range

    fn insert_range(self: &Self, items: impl IntoIterator<Item = T>, index: usize)
    

    Inserts the items at index (InsertRange, ListEx.AddRange(items, index)).

    Source

    move_item

    fn move_item(self: &Self, original: usize, destination: usize)
    

    Moves the item at original to destination (Move; move is a keyword of Rust).

    Source

    remove

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

    Removes the first item equal to item; whether there was one (Remove).

    Source

    remove_at

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

    Removes the item at index (RemoveAt).

    Source

    remove_many

    fn remove_many(self: &Self, items_to_remove: impl IntoIterator<Item = T>)
    

    Removes the items (RemoveMany).

    Source

    remove_range

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

    Removes count items from index (RemoveRange).

    Source

    replace

    fn replace(self: &Self, original: &T, destination: T)
    

    Replaces original with destination (Replace).

    Panics

    When original is not in the list (ArgumentException).

    Source

    replace_at

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

    Replaces the item at index with item (ReplaceAt).

    Source

    Trait implementations

    Availability

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