IList
trait · ferroui-dynamic-data · v0.5.0
trait IList<T: Clone + PartialEq>
A list that the changes of a list can be applied to (System.Collections.Generic.IList<T>,
with the forms of ListEx as provided methods).
Members
countgetsetinsertremove_atclearaddindex_ofindex_of_withremoveadd_rangeadd_or_insert_rangeremove_rangesupports_rangesmove_itemrefresh_at
count
fn count(self: &Self) -> usize
The number of items (Count).
get
fn get(self: &Self, index: usize) -> T
The item at index (the indexer's getter).
set
fn set(self: &mut Self, index: usize, item: T)
Replaces the item at index (the indexer's setter).
insert
fn insert(self: &mut Self, index: usize, item: T)
Inserts an item (Insert).
remove_at
fn remove_at(self: &mut Self, index: usize)
Removes the item at index (RemoveAt).
clear
fn clear(self: &mut Self)
Removes every item (Clear).
add
fn add(self: &mut Self, item: T)
Adds an item at the end (Add).
index_of
fn index_of(self: &Self, item: &T) -> Option<usize>
The index of item (IndexOf).
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 (ListEx.IndexOf(IEnumerable, T, IEqualityComparer)).
remove
fn remove(self: &mut Self, item: &T) -> bool
Removes item; false when it is not in the list (Remove).
add_range
fn add_range(self: &mut Self, items: Vec<T>)
Adds the items at the end (ListEx.AddRange): one by one unless the list adds ranges.
add_or_insert_range
fn add_or_insert_range(self: &mut Self, items: Vec<T>, index: Option<usize>)
Inserts the items at index, or adds them without an index (ListEx.AddOrInsertRange): in
reverse order at the index unless the list inserts ranges, as upstream does.
remove_range
fn remove_range(self: &mut Self, _index: usize, _count: usize)
Removes count items from index (ListEx.RemoveRange).
Panics
For a list without ranges (NotSupportedException).
supports_ranges
fn supports_ranges(self: &Self) -> bool
Whether the list removes ranges at once (List<T> or IExtendedList<T>).
move_item
fn move_item(self: &mut Self, original: usize, destination: usize)
Moves the item at original to destination (the Moved case of ListEx.Clone).
refresh_at
fn refresh_at(self: &mut Self, index: usize, item: T)
Reports a refresh of the item at index (the Refresh case of ListEx.Clone): the item is
removed and inserted again unless the list reports refreshes.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.