pub struct CalendarState {
pub focus_handle: FocusHandle,
/* private fields */
}Fields§
§focus_handle: FocusHandleImplementations§
Source§impl CalendarState
impl CalendarState
pub fn new(_: &mut Window, cx: &mut Context<'_, CalendarState>) -> CalendarState
pub fn disabled_matcher(self, matcher: impl Into<Matcher>) -> CalendarState
pub fn set_disabled_matcher( &mut self, matcher: impl Into<Matcher>, _: &mut Window, _: &mut Context<'_, CalendarState>, )
pub fn disabled_matcher_ref(&self) -> Option<&Matcher>
pub fn set_date( &mut self, date: impl Into<Date>, _: &mut Window, cx: &mut Context<'_, CalendarState>, )
pub fn apply_date(&mut self, date: Date) -> bool
pub fn select_date(&mut self, value: NaiveDate) -> bool
Sourcepub fn activate_date(
&mut self,
value: NaiveDate,
cx: &mut Context<'_, CalendarState>,
) -> bool
pub fn activate_date( &mut self, value: NaiveDate, cx: &mut Context<'_, CalendarState>, ) -> bool
Activates a day item and emits CalendarEvent::Selected once the
controlled value is complete. This is the single pointer/keyboard
activation path used by the calendar root.
pub fn date(&self) -> Date
pub fn set_number_of_months( &mut self, n: usize, _: &mut Window, cx: &mut Context<'_, CalendarState>, )
pub fn number_of_months(&self) -> usize
pub fn year_range(self, range: (i32, i32)) -> CalendarState
pub fn set_year_range( &mut self, range: (i32, i32), cx: &mut Context<'_, CalendarState>, )
pub fn offset_year_month(&self, offset: usize) -> (i32, u32)
pub fn days(&self) -> Vec<Vec<NaiveDate>>
Sourcepub fn month_days(&self) -> Vec<Vec<Vec<NaiveDate>>>
pub fn month_days(&self) -> Vec<Vec<Vec<NaiveDate>>>
Calendar weeks grouped by visible month. This preserves six-week months and is the preferred rendering API.
pub fn has_prev_year_page(&self) -> bool
pub fn has_next_year_page(&self) -> bool
pub fn prev_year_page(&mut self) -> bool
pub fn next_year_page(&mut self) -> bool
pub fn prev_month(&mut self)
pub fn next_month(&mut self)
pub fn view(&self) -> CalendarView
pub fn set_view(&mut self, view: CalendarView)
pub fn current_year(&self) -> i32
pub fn current_month(&self) -> u8
pub fn today(&self) -> NaiveDate
pub fn years_on_page(&self) -> &[i32]
pub fn select_month(&mut self, month: u8)
pub fn select_year(&mut self, year: i32)
Trait Implementations§
impl EventEmitter<CalendarEvent> for CalendarState
Source§impl Render for CalendarState
impl Render for CalendarState
Source§fn render(
&mut self,
_: &mut Window,
_: &mut Context<'_, CalendarState>,
) -> impl IntoElement
fn render( &mut self, _: &mut Window, _: &mut Context<'_, CalendarState>, ) -> impl IntoElement
Render this view into an element tree.
Auto Trait Implementations§
impl !RefUnwindSafe for CalendarState
impl !Send for CalendarState
impl !Sync for CalendarState
impl !UnwindSafe for CalendarState
impl Freeze for CalendarState
impl Unpin for CalendarState
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more