pub struct Entries { /* private fields */ }calendar only.Expand description
The entries of a calendar and the time zone they are shown in.
Two collections are equal when they hold the same entries in the same time zone, whatever ids they have handed out.
Implementations§
Source§impl Entries
impl Entries
Sourcepub fn system() -> Self
pub fn system() -> Self
An empty collection shown in the system’s time zone, or UTC when the system does not say.
Sourcepub fn with(self, entries: impl IntoIterator<Item = Entry>) -> Self
pub fn with(self, entries: impl IntoIterator<Item = Entry>) -> Self
Adds entries while building. An entry with an id already present replaces the earlier one.
pub fn time_zone(&self) -> &TimeZone
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = &Entry>
pub fn get(&self, id: EntryId) -> Option<&Entry>
Sourcepub fn next_id(&self) -> EntryId
pub fn next_id(&self) -> EntryId
An id no entry in this collection has ever used, including entries since removed, so ids kept outside the calendar never point at a different entry. Ids only go up.
Sourcepub fn insert(&mut self, entry: Entry) -> Option<Changed>
pub fn insert(&mut self, entry: Entry) -> Option<Changed>
Adds entry, or replaces the entry with the same id. Returns what
changed, or None when an identical entry was already there.
Sourcepub fn remove(&mut self, id: EntryId) -> Option<Changed>
pub fn remove(&mut self, id: EntryId) -> Option<Changed>
Removes the entry with id, if there is one.
Sourcepub fn date_of(&self, instant: Timestamp) -> Date
pub fn date_of(&self, instant: Timestamp) -> Date
The calendar date of instant in the collection’s time zone.
Sourcepub fn midnight(&self, date: Date) -> Timestamp
pub fn midnight(&self, date: Date) -> Timestamp
Midnight at the start of date in the collection’s time zone.
Sourcepub fn occurrences(&self, from: Timestamp, to: Timestamp) -> Vec<Occurrence>
pub fn occurrences(&self, from: Timestamp, to: Timestamp) -> Vec<Occurrence>
Every occurrence that overlaps the time from from up to to,
earliest first. Repeating entries are expanded.
Sourcepub fn between(&self, first: Date, last: Date) -> Vec<Occurrence>
pub fn between(&self, first: Date, last: Date) -> Vec<Occurrence>
Every occurrence that touches a date from first to last
inclusive.
Sourcepub fn on(&self, date: Date) -> Vec<Occurrence>
pub fn on(&self, date: Date) -> Vec<Occurrence>
Every occurrence that touches date.
Trait Implementations§
impl Eq for Entries
Auto Trait Implementations§
impl Forget for Entries
impl Freeze for Entries
impl Move for Entries
impl RefUnwindSafe for Entries
impl Send for Entries
impl Sync for Entries
impl Unpin for Entries
impl UnsafeUnpin for Entries
impl UnwindSafe for Entries
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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.