pub struct TimeCalendarEvent {
pub common: CalendarEventCommon,
pub start: Timestamp,
pub end: Option<Timestamp>,
pub start_tzid: Option<String>,
pub end_tzid: Option<String>,
}Expand description
Typed bundle for a kind: 31923 time-based calendar event.
Fields§
§common: CalendarEventCommonFields common to every calendar event.
start: TimestampInclusive start Unix timestamp.
end: Option<Timestamp>Exclusive end Unix timestamp. If absent, the event ends instantaneously (spec §“Time-Based Calendar Event”).
start_tzid: Option<String>Optional start_tzid IANA time-zone identifier.
end_tzid: Option<String>Optional end_tzid IANA time-zone identifier.
Implementations§
Source§impl TimeCalendarEvent
impl TimeCalendarEvent
Sourcepub fn day_floors(&self) -> Vec<i64>
pub fn day_floors(&self) -> Vec<i64>
Compute the spec-required D day-granularity floor
timestamps spanning start..=end.
The spec §“Time-Based Calendar Event” requires
D = floor(unix_seconds() / seconds_in_one_day) and multiple
tags to span the range. If end is None, a single D row
is emitted for start.
Source§impl TimeCalendarEvent
impl TimeCalendarEvent
Sourcepub fn new(
identifier: impl Into<String>,
title: impl Into<String>,
start: Timestamp,
) -> Self
pub fn new( identifier: impl Into<String>, title: impl Into<String>, start: Timestamp, ) -> Self
Construct a time-based calendar event with the spec-required columns.
Sourcepub fn start_tzid(self, tzid: impl Into<String>) -> Self
pub fn start_tzid(self, tzid: impl Into<String>) -> Self
Set the start_tzid IANA identifier.
Sourcepub fn coordinate(&self, author: PublicKey) -> Coordinate
pub fn coordinate(&self, author: PublicKey) -> Coordinate
Build the event’s addressable coordinate.
Sourcepub fn from_event(event: &Event) -> Result<Self, CalendarError>
pub fn from_event(event: &Event) -> Result<Self, CalendarError>
Trait Implementations§
Source§impl Clone for TimeCalendarEvent
impl Clone for TimeCalendarEvent
Source§fn clone(&self) -> TimeCalendarEvent
fn clone(&self) -> TimeCalendarEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TimeCalendarEvent
impl Debug for TimeCalendarEvent
impl Eq for TimeCalendarEvent
Source§impl PartialEq for TimeCalendarEvent
impl PartialEq for TimeCalendarEvent
impl StructuralPartialEq for TimeCalendarEvent
Auto Trait Implementations§
impl Freeze for TimeCalendarEvent
impl RefUnwindSafe for TimeCalendarEvent
impl Send for TimeCalendarEvent
impl Sync for TimeCalendarEvent
impl Unpin for TimeCalendarEvent
impl UnsafeUnpin for TimeCalendarEvent
impl UnwindSafe for TimeCalendarEvent
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
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<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
Compare self to
key and return true if they are equal.