IReadOnlySelectionList
trait · ferroui-controls · v0.5.0
trait IReadOnlySelectionList<T: Clone + PartialEq + 'static>
A read-only, indexable list exposed by a selection model: the selected
indexes (T = i32) or the selected items (T = Option<_>, a null
item being None).
A list is a view: it reads the selection when it is asked, it does not
copy it. Handles are Rc<dyn IReadOnlySelectionList<T>>.
Members
count
fn count(self: &Self) -> usize
The number of elements.
get
fn get(self: &Self, index: usize) -> T
The element at index. Panics if the index is out of range.
iter
fn iter(self: &Self) -> Box<dyn Iterator<Item = T>>
Enumerates the elements.
add_collection_changed
fn add_collection_changed(self: &Self, _handler: Rc<ItemsChangedHandler>) -> Option<u64>
Subscribes to changes of the list. Returns the token for
remove_collection_changed, or
None if the list does not notify.
remove_collection_changed
fn remove_collection_changed(self: &Self, _token: u64)
Unsubscribes a handler.
is_empty
fn is_empty(self: &Self) -> bool
Whether the list has no elements.
contains
fn contains(self: &Self, value: &T) -> bool
Whether the list contains an element equal to value.
index_of
fn index_of(self: &Self, value: &T) -> i32
The index of the first element equal to value, or -1.
to_vec
fn to_vec(self: &Self) -> Vec<T>
Copies the elements.
Trait implementations
IReadOnlySelectionList<T>IReadOnlySelectionList<i32>IReadOnlySelectionList<Option<T>>IReadOnlySelectionList<Option<Rc<dyn AnyValue>>>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.