FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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>>.

    View source

    Members

    count

    fn count(self: &Self) -> usize
    

    The number of elements.

    Source

    get

    fn get(self: &Self, index: usize) -> T
    

    The element at index. Panics if the index is out of range.

    Source

    iter

    fn iter(self: &Self) -> Box<dyn Iterator<Item = T>>
    

    Enumerates the elements.

    Source

    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.

    Source

    remove_collection_changed

    fn remove_collection_changed(self: &Self, _token: u64)
    

    Unsubscribes a handler.

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Whether the list has no elements.

    Source

    contains

    fn contains(self: &Self, value: &T) -> bool
    

    Whether the list contains an element equal to value.

    Source

    index_of

    fn index_of(self: &Self, value: &T) -> i32
    

    The index of the first element equal to value, or -1.

    Source

    to_vec

    fn to_vec(self: &Self) -> Vec<T>
    

    Copies the elements.

    Source

    Trait implementations

    Availability

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