FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SelectedDatesCollection

    struct · ferroui-controls · v0.5.0

    struct SelectedDatesCollection
    

    Represents a set of selected dates in a Calendar.

    The value is a shared handle: clones refer to the same collection, and handles compare by identity. Every change goes through the collection, which validates it against the selection mode of the calendar that owns it and keeps the selected date of that calendar in step.

    View source

    Members

    new

    fn new(owner: &Ref<Calendar>) -> Self
    

    Initializes a new instance of the SelectedDatesCollection class.

    owner is the Calendar associated with this object.

    Source

    add_range

    fn add_range(self: &Self, start: DateTime, end: DateTime)
    

    Adds all the dates in the specified range, which includes the first and last dates, to the collection.

    start is the first date to add to the collection and end the last one.

    Source

    count

    fn count(self: &Self) -> usize
    

    The number of dates in the collection.

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Whether the collection has no dates.

    Source

    get

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

    The date at index. Panics when the index is out of range.

    Source

    to_vec

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

    The dates of the collection, as they are now.

    Source

    contains

    fn contains(self: &Self, item: DateTime) -> bool
    

    Whether the collection contains the date.

    Source

    index_of

    fn index_of(self: &Self, item: DateTime) -> Option<usize>
    

    The index of the date in the collection.

    Source

    add

    fn add(self: &Self, item: DateTime)
    

    Adds a date to the end of the collection.

    Panics when the selection mode of the calendar does not allow the change or the date cannot be selected.

    Source

    insert

    fn insert(self: &Self, index: usize, item: DateTime)
    

    Inserts a date into the collection at the specified index.

    Panics when the selection mode of the calendar does not allow the change or the date cannot be selected.

    Source

    remove

    fn remove(self: &Self, item: DateTime) -> bool
    

    Removes a date from the collection. Returns whether it was present.

    Source

    remove_at

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

    Removes the date at the specified index of the collection.

    Source

    set

    fn set(self: &Self, index: usize, item: DateTime)
    

    Replaces the date at the specified index.

    Source

    clear

    fn clear(self: &Self)
    

    Removes all dates from the collection.

    Source

    move_item

    fn move_item(self: &Self, old_index: usize, new_index: usize)
    

    Moves the date at old_index to new_index.

    Source

    add_collection_changed

    fn add_collection_changed(self: &Self, handler: Rc<CollectionChangedHandler<DateTime>>) -> u64
    

    Subscribes to the changes of the collection; returns the token of the subscription.

    Source

    remove_collection_changed

    fn remove_collection_changed(self: &Self, token: u64) -> bool
    

    Ends a subscription to the changes of the collection.

    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
    • Clone
    • PartialEq

    Availability

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