FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ItemsSource

    struct · ferroui-controls · v0.5.0

    struct ItemsSource
    

    A shared handle to an untyped items list: the value of an items source property.

    Equality is the identity of the underlying collection.

    View source

    Members

    new

    fn new(list: Rc<dyn IItemsList>) -> Self
    

    Wraps a list.

    Source

    from_items

    fn from_items(items: impl IntoIterator<Item = Option<BoxedValue>>) -> Self
    

    Creates a non-notifying source holding the given items.

    Source

    from_values

    fn from_values<T: PropertyValue>(values: impl IntoIterator<Item = T>) -> Self
    

    Creates a non-notifying source by boxing each of the given values.

    Source

    from_strs

    fn from_strs<'a>(values: impl IntoIterator<Item = &'a str>) -> Self
    

    Creates a non-notifying source of strings.

    Source

    list

    fn list(self: &Self) -> &Rc<dyn IItemsList>
    

    The list.

    Source

    count

    fn count(self: &Self) -> usize
    

    The number of items.

    Source

    get_at

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

    The item at index. Panics if out of range.

    Source

    index_of

    fn index_of(self: &Self, item: &Option<BoxedValue>) -> i32
    

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

    Source

    contains

    fn contains(self: &Self, item: &Option<BoxedValue>) -> bool
    

    Whether the list contains an item equal to item.

    Source

    is_notifying

    fn is_notifying(self: &Self) -> bool
    

    Whether the list notifies of changes.

    Source

    downcast_ref

    fn downcast_ref<T: 'static>(self: &Self) -> Option<&T>
    

    The typed collection behind the source, if it is a T.

    Source

    identity

    fn identity(self: &Self) -> usize
    

    The identity of the underlying collection.

    Source

    ptr_eq

    fn ptr_eq(self: &Self, other: &ItemsSource) -> bool
    

    Whether two handles refer to the same collection.

    Source

    iter

    fn iter(self: &Self) -> impl Iterator<Item = Option<BoxedValue>> + '_
    

    The items, enumerated by index over the live list.

    Source

    to_vec

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

    A copy of the items.

    Source

    register_binding_conversion_with

    fn register_binding_conversion_with<S: 'static>(convert: fn(&S) -> ItemsSource)
    

    Lets bindings deliver a value of the collection type S to a property of type Option<ItemsSource> (or ItemsSource) on the current thread. register_binding_conversion for a collection type that converts with convert (a list handle that is delivered as the shared list).

    Source

    register_binding_conversion

    fn register_binding_conversion<S: Clone + Into<ItemsSource> + 'static>()
    

    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
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • MarkupTyped
    • From<NavigationStack>
    • From<&'a ItemsSource>
    • Clone
    • PartialEq
    • Debug
    • From<Rc<dyn IItemsList>>
    • From<Rc<ItemsSourceView>>
    • From<Rc<FerroList<T>>>
    • From<Rc<BindableList<T>>>
    • From<Vec<Option<Rc<dyn AnyValue>>>>
    • From<Vec<Rc<dyn AnyValue>>>
    • From<Rc<Vec<Option<Rc<dyn AnyValue>>>>>
    • From<CommandBarElementCollection>

    Availability

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