IFerroList
trait · ferroui-base · v0.5.0
trait IFerroList<T>: IFerroReadOnlyList<T>
A notifying list.
The members of the list contract it extends (add, insert, remove, search) are part of the trait. Ranges are passed as vectors, so that the trait can be used as an object.
Members
setaddinsertremove_atclearcontainsindex_ofremoveadd_rangeinsert_rangemove_itemmove_rangeremove_allremove_range
set
fn set(self: &Self, index: usize, value: T)
Sets the element at the specified index.
add
fn add(self: &Self, item: T)
Adds an item to the collection.
insert
fn insert(self: &Self, index: usize, item: T)
Inserts an item at the specified index.
remove_at
fn remove_at(self: &Self, index: usize)
Removes the item at the specified index.
clear
fn clear(self: &Self)
Removes all items from the collection.
contains
fn contains(self: &Self, item: &T) -> bool
Tests whether the collection contains an item.
index_of
fn index_of(self: &Self, item: &T) -> Option<usize>
The index of an item in the collection.
remove
fn remove(self: &Self, item: &T) -> bool
Removes an item from the collection. Returns true if it was present.
add_range
fn add_range(self: &Self, items: Vec<T>)
Adds multiple items to the collection.
insert_range
fn insert_range(self: &Self, index: usize, items: Vec<T>)
Inserts multiple items at the specified index.
move_item
fn move_item(self: &Self, old_index: usize, new_index: usize)
Moves an item to a new index.
move_range
fn move_range(self: &Self, old_index: usize, count: usize, new_index: usize)
Moves multiple items to a new index.
remove_all
fn remove_all(self: &Self, items: Vec<T>)
Removes multiple items from the collection.
remove_range
fn remove_range(self: &Self, index: usize, count: usize)
Removes a range of elements from the collection.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.