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.
Members
addadd_rangeclearedit_diffedit_diff_with_comparerinsertinsert_rangemove_itemremoveremove_atremove_manyremove_rangereplacereplace_at
add
fn add(self: &Self, item: T)
Adds item (Add).
add_range
fn add_range(self: &Self, items: impl IntoIterator<Item = T>)
Adds the items (AddRange).
clear
fn clear(self: &Self)
Removes every item (Clear).
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)).
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>)).
insert
fn insert(self: &Self, index: usize, item: T)
Inserts item at index (Insert).
insert_range
fn insert_range(self: &Self, items: impl IntoIterator<Item = T>, index: usize)
Inserts the items at index (InsertRange, ListEx.AddRange(items, index)).
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).
remove
fn remove(self: &Self, item: &T) -> bool
Removes the first item equal to item; whether there was one (Remove).
remove_at
fn remove_at(self: &Self, index: usize)
Removes the item at index (RemoveAt).
remove_many
fn remove_many(self: &Self, items_to_remove: impl IntoIterator<Item = T>)
Removes the items (RemoveMany).
remove_range
fn remove_range(self: &Self, index: usize, count: usize)
Removes count items from index (RemoveRange).
replace
fn replace(self: &Self, original: &T, destination: T)
Replaces original with destination (Replace).
Panics
When original is not in the list (ArgumentException).
replace_at
fn replace_at(self: &Self, index: usize, item: T)
Replaces the item at index with item (ReplaceAt).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.