FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ItemCollection

    struct · ferroui-controls · v0.5.0

    struct ItemCollection
    

    Holds the list of items that constitute the content of an ItemsControl.

    The value is a shared handle: clones refer to the same collection, and handles compare by identity.

    View source

    Members

    view

    fn view(self: &Self) -> &Rc<ItemsSourceView>
    

    The read-only view of the collection.

    Source

    set

    fn set(self: &Self, index: usize, value: Option<BoxedValue>)
    

    Replaces the item at the specified index.

    Panics if the collection is in items source mode.

    Source

    is_read_only

    fn is_read_only(self: &Self) -> bool
    

    Whether the collection is in items source mode.

    Source

    add

    fn add(self: &Self, value: Option<BoxedValue>) -> i32
    

    Adds an item to the items control.

    Returns the position into which the new element was inserted. Panics if the collection is in items source mode.

    Source

    clear

    fn clear(self: &Self)
    

    Clears the collection and releases the references on all items currently in the collection.

    Panics if the collection is in items source mode.

    Source

    insert

    fn insert(self: &Self, index: usize, value: Option<BoxedValue>)
    

    Inserts an element into the collection at the specified index.

    Panics if the collection is in items source mode.

    Source

    remove_at

    fn remove_at(self: &Self, index: usize)
    

    Removes the item at the specified index of the collection or view.

    Panics if the collection is in items source mode.

    Source

    remove

    fn remove(self: &Self, value: &Option<BoxedValue>) -> bool
    

    Removes the specified item reference from the collection or view. Returns true if the item was removed.

    Panics if the collection is in items source mode.

    Source

    Trait implementations

    Availability

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