pub struct CalendarState {
pub year: i32,
pub month: u32,
pub selected_day: Option<u32>,
/* private fields */
}Expand description
State for the calendar date picker widget.
Fields§
§year: i32Current display year.
month: u32Current display month (1–12).
selected_day: Option<u32>Currently selected day, if any.
Implementations§
Source§impl CalendarState
impl CalendarState
Sourcepub fn from_ym(year: i32, month: u32) -> Self
pub fn from_ym(year: i32, month: u32) -> Self
Create a CalendarState for a specific year and month.
Sourcepub fn selected_date(&self) -> Option<(i32, u32, u32)>
pub fn selected_date(&self) -> Option<(i32, u32, u32)>
Returns the selected date as (year, month, day), if any.
Sourcepub fn prev_month(&mut self)
pub fn prev_month(&mut self)
Navigate to the previous month.
Sourcepub fn next_month(&mut self)
pub fn next_month(&mut self)
Navigate to the next month.
Trait Implementations§
Source§impl Clone for CalendarState
impl Clone for CalendarState
Source§fn clone(&self) -> CalendarState
fn clone(&self) -> CalendarState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CalendarState
impl Debug for CalendarState
Auto Trait Implementations§
impl Freeze for CalendarState
impl RefUnwindSafe for CalendarState
impl Send for CalendarState
impl Sync for CalendarState
impl Unpin for CalendarState
impl UnsafeUnpin for CalendarState
impl UnwindSafe for CalendarState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more