pub struct State { /* private fields */ }calendar only.Expand description
The entries, the view, the period on show and the selection.
Implementations§
Source§impl State
impl State
Sourcepub fn new(today: Date) -> Self
pub fn new(today: Date) -> Self
An empty calendar in UTC showing the month of today.
The calendar never reads the clock. Pass today’s date here, and
keep it current with Event::Tick if the app stays open.
Sourcepub fn at(now: Timestamp, entries: Entries) -> Self
pub fn at(now: Timestamp, entries: Entries) -> Self
A calendar showing the month of now in the time zone of
entries, with the now line drawn.
Sourcepub fn with_entries(self, entries: Entries) -> Self
pub fn with_entries(self, entries: Entries) -> Self
Replaces the entries and their time zone.
pub fn with_view(self, view: View) -> Self
Sourcepub fn with_week_start(self, week_start: Weekday) -> Self
pub fn with_week_start(self, week_start: Weekday) -> Self
The day weeks start on. Defaults to Monday.
Sourcepub fn with_cursor(self, date: Date) -> Self
pub fn with_cursor(self, date: Date) -> Self
Shows the period holding date.
pub fn with_selection(self, selection: Selection) -> Self
Sourcepub fn with_allow(self, allow: Allow) -> Self
pub fn with_allow(self, allow: Allow) -> Self
Limits what the user may change through the calendar itself.
Sourcepub fn read_only(self) -> Self
pub fn read_only(self) -> Self
A calendar the user can look through but not change: nothing can
be created, dragged or removed from it. The same as
with_allow with Allow::NONE.
Sourcepub fn set_allow(&mut self, allow: Allow)
pub fn set_allow(&mut self, allow: Allow)
Changes what the user may do, such as when they sign in or a calendar they cannot edit comes on show.
pub fn allow(&self) -> Allow
pub fn entries(&self) -> &Entries
pub fn time_zone(&self) -> &TimeZone
pub fn view(&self) -> View
pub fn today(&self) -> Date
Sourcepub fn now(&self) -> Option<Timestamp>
pub fn now(&self) -> Option<Timestamp>
The time of the last Event::Tick, which is where the now line
is drawn.
pub fn week_start(&self) -> Weekday
pub fn selection(&self) -> Option<Selection>
Sourcepub fn selected_entry(&self) -> Option<&Entry>
pub fn selected_entry(&self) -> Option<&Entry>
The selected entry, if an entry is selected.
Sourcepub fn selected_day(&self) -> Option<Date>
pub fn selected_day(&self) -> Option<Date>
The day the selection is on, if anything is selected.
pub fn is_selected(&self, selection: Selection) -> bool
Sourcepub fn range(&self) -> (Date, Date)
pub fn range(&self) -> (Date, Date)
The first and last date on show. The month view includes the days of neighbouring months that fill its first and last weeks.
Sourcepub fn short_title(&self) -> String
pub fn short_title(&self) -> String
A shorter title for narrow screens, such as
“Thu 19 Nov 2026” for a day and “30 Nov - 6 Dec” for a week that
crosses months.
Trait Implementations§
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Forget for State
impl Freeze for State
impl Move for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.