FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ItemsView

    struct · ferroui-controls · v0.5.0

    struct ItemsView<'a>
    

    The items carried by a change notification of an untyped items list: a cheap, copyable view that produces an item only when asked for it.

    See the module documentation ("Change notifications").

    View source

    Members

    EMPTY

    const EMPTY: ItemsView<'static>
    

    A view of no items.

    Source

    from_slice

    const fn from_slice(items: &'a [Option<BoxedValue>]) -> Self
    

    A view of existing untyped items.

    Source

    window

    fn window(list: &'a dyn IItemsList, start: usize, count: usize) -> Self
    

    A view of count items of list starting at start. Nothing is read from the list until an item is asked for.

    Source

    of_source

    fn of_source(source: &'a ItemsSource) -> Self
    

    A view of all the items of source. Only the count is read.

    Source

    of_source_range

    fn of_source_range(source: &'a ItemsSource, start: usize, count: usize) -> Self
    

    A view of count items of source starting at start.

    Source

    from_typed

    fn from_typed<T: PropertyValue>(items: &'a TypedItems<'a, T>) -> Self
    

    A view of typed items, each boxed when it is read.

    Source

    len

    fn len(self: &Self) -> usize
    

    The number of items. Never reads an item.

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Whether the view has no items. Never reads an item.

    Source

    get

    fn get(self: &Self, index: usize) -> Option<BoxedValue>
    

    The item at index. Panics if out of range.

    Source

    iter

    fn iter(self: &Self) -> ItemsViewIter<'a>
    

    The items, each read when the iterator reaches it.

    Source

    to_vec

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

    A copy of the items. Reads every item.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Default
    • Debug
    • From<&'a [Option<Rc<dyn AnyValue>>]>
    • From<&'a Vec<Option<Rc<dyn AnyValue>>>>
    • From<&'a [Option<Rc<dyn AnyValue>>; N]>
    • From<&'a ItemsSource>
    • IntoIterator

    Availability

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