FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ListObservable

    struct · ferroui-reactive · v0.5.0

    struct ListObservable<T>
    

    The values of a sequence as a list, once the sequence has ended (ListObservable<T>), and the sequence of its end.

    The list subscribes to the source when it is made, and keeps its values; the list can then be read and changed as a list once the source has completed.

    View source

    Members

    new

    fn new(source: Rc<dyn IObservable<T>>) -> Rc<Self>
    

    The list of the values of source (ListObservable(IObservable<T>)).

    Source

    value

    fn value(self: &Self) -> Result<T, ObservableError>
    where T: Clone
    

    The last value (Value); an Err with SequenceError::NoElements when there is none.

    Source

    index_of

    fn index_of(self: &Self, item: &T) -> Result<Option<usize>, ObservableError>
    where T: PartialEq
    

    The index of the first value equal to item (IndexOf).

    Source

    insert

    fn insert(self: &Self, index: usize, item: T) -> Result<(), ObservableError>
    

    Inserts item at index (Insert); an index beyond the count is an ArgumentOutOfRangeError.

    Source

    remove_at

    fn remove_at(self: &Self, index: usize) -> Result<(), ObservableError>
    

    Removes the value at index (RemoveAt).

    Source

    get

    fn get(self: &Self, index: usize) -> Result<T, ObservableError>
    where T: Clone
    

    The value at index (the getter of the indexer).

    Source

    set

    fn set(self: &Self, index: usize, value: T) -> Result<(), ObservableError>
    

    Replaces the value at index (the setter of the indexer).

    Source

    add

    fn add(self: &Self, item: T) -> Result<(), ObservableError>
    

    Adds item at the end (Add).

    Source

    clear

    fn clear(self: &Self) -> Result<(), ObservableError>
    

    Removes every value (Clear).

    Source

    contains

    fn contains(self: &Self, item: &T) -> Result<bool, ObservableError>
    where T: PartialEq
    

    Whether a value equals item (Contains).

    Source

    copy_to

    fn copy_to(self: &Self, array: &mut [T], array_index: usize) -> Result<(), ObservableError>
    where T: Clone
    

    Copies the values into array from array_index on (CopyTo); an array too short is an ArgumentOutOfRangeError.

    Source

    count

    fn count(self: &Self) -> Result<usize, ObservableError>
    

    The count of the values (Count).

    Source

    is_read_only

    fn is_read_only(self: &Self) -> bool
    

    Whether the list cannot be changed (IsReadOnly): it can.

    Source

    remove

    fn remove(self: &Self, item: &T) -> Result<bool, ObservableError>
    where T: PartialEq
    

    Removes the first value equal to item (Remove); whether there was one.

    Source

    to_vec

    fn to_vec(self: &Self) -> Result<Vec<T>, ObservableError>
    where T: Clone
    

    The values, in order (GetEnumerator).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • SubscribeGuard<T>
    • IObservable<()>

    Availability

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