FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CalendarBlackoutDatesCollection

    struct · ferroui-controls · v0.5.0

    struct CalendarBlackoutDatesCollection
    

    Represents a collection of non-selectable 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 and refreshes the calendar that owns it.

    View source

    Members

    new

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

    Initializes a new instance of the CalendarBlackoutDatesCollection class.

    owner is the Calendar whose dates this object represents.

    Source

    add_dates_in_past

    fn add_dates_in_past(self: &Self)
    

    Adds all dates before today to the collection.

    Source

    contains_date

    fn contains_date(self: &Self, date: DateTime) -> bool
    

    Returns a value that represents whether this collection contains the specified date.

    Source

    contains_dates

    fn contains_dates(self: &Self, start: DateTime, end: DateTime) -> bool
    

    Returns a value that represents whether this collection contains the specified range of dates: start is the start of the date range and end the end of it.

    Source

    contains_any

    fn contains_any(self: &Self, range: &CalendarDateRange) -> bool
    

    Returns a value that represents whether this collection contains any date in the specified range.

    Source

    count

    fn count(self: &Self) -> usize
    

    The number of ranges in the collection.

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Whether the collection has no ranges.

    Source

    get

    fn get(self: &Self, index: usize) -> Rc<CalendarDateRange>
    

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

    Source

    to_vec

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

    The ranges of the collection, as they are now.

    Source

    contains

    fn contains(self: &Self, item: &Rc<CalendarDateRange>) -> bool
    

    Whether the collection contains the range (the same range object).

    Source

    index_of

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

    The index of the range (the same range object) in the collection.

    Source

    add

    fn add(self: &Self, item: Rc<CalendarDateRange>)
    

    Adds a range to the end of the collection.

    Panics when the range contains a selected date of the calendar.

    Source

    insert

    fn insert(self: &Self, index: usize, item: Rc<CalendarDateRange>)
    

    Inserts a range into the collection at the specified index.

    Panics when the range contains a selected date of the calendar.

    Source

    remove

    fn remove(self: &Self, item: &Rc<CalendarDateRange>) -> bool
    

    Removes the range (the same range object) from the collection. Returns whether it was present.

    Source

    remove_at

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

    Removes the range at the specified index of the collection.

    Source

    set

    fn set(self: &Self, index: usize, item: Rc<CalendarDateRange>)
    

    Replaces the range at the specified index.

    Panics when the range contains a selected date of the calendar.

    Source

    clear

    fn clear(self: &Self)
    

    Removes all ranges from the collection.

    Source

    move_item

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

    Moves the range at old_index to new_index.

    Source

    add_collection_changed

    fn add_collection_changed(self: &Self, handler: Rc<CollectionChangedHandler<Rc<CalendarDateRange>>>) -> 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.