pub struct Event {Show 19 fields
pub uid: EventUid,
pub summary: Option<String>,
pub description: Option<String>,
pub location: Option<String>,
pub start: EventTime,
pub end: Option<EventTime>,
pub status: Status,
pub availability: Availability,
pub visibility: Option<Visibility>,
pub recurrence: Option<Recurrence>,
pub recurrence_id: Option<RecurrenceId>,
pub organizer: Option<Organizer>,
pub attendees: Vec<Attendee>,
pub reminders: Vec<Reminder>,
pub url: Option<String>,
pub attachments: Vec<Attachment>,
pub x_properties: Vec<XProperty>,
pub last_modified: Option<DateTime<Utc>>,
pub sequence: i32,
}Fields§
§uid: EventUid§summary: Option<String>§description: Option<String>§location: Option<String>§start: EventTime§end: Option<EventTime>§status: Status§availability: Availability§visibility: Option<Visibility>§recurrence: Option<Recurrence>§recurrence_id: Option<RecurrenceId>§organizer: Option<Organizer>§attendees: Vec<Attendee>§reminders: Vec<Reminder>§url: Option<String>§attachments: Vec<Attachment>§x_properties: Vec<XProperty>§last_modified: Option<DateTime<Utc>>§sequence: i32Implementations§
Source§impl Event
impl Event
Sourcepub fn base_slug(&self) -> String
pub fn base_slug(&self) -> String
Generate a slug for an event based on its start time and summary. The slug is used as the filename for the event’s .ics file.
Recurring events happen on many dates, so a single date prefix would be
misleading. They get a _recurring__ prefix instead, which also groups
them together when browsing the directory.
Source§impl Event
impl Event
pub fn new(summary: impl Into<String>, start: EventTime) -> Self
Sourcepub fn from_ics_str(
contents: &str,
) -> Result<Vec<Result<Self, EventError>>, EventError>
pub fn from_ics_str( contents: &str, ) -> Result<Vec<Result<Self, EventError>>, EventError>
Parse ICS document to list of events
pub fn to_ics_string(&self) -> String
pub fn occurs_in_range(&self, from: DateTime<Utc>, to: DateTime<Utc>) -> bool
Sourcepub fn has_occurrence_in_range(
&self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> bool
pub fn has_occurrence_in_range( &self, from: DateTime<Utc>, to: DateTime<Utc>, ) -> bool
Like occurs_in_range(), but expands the RRULE for recurring events
so a master with UNTIL in the past correctly reports no overlap.
Sourcepub fn is_invite_for(&self, email: &str) -> bool
pub fn is_invite_for(&self, email: &str) -> bool
True if email is an attendee but NOT the organizer
Sourcepub fn attendee_status(&self, email: &str) -> Option<ParticipationStatus>
pub fn attendee_status(&self, email: &str) -> Option<ParticipationStatus>
Get the user’s participation status for this event
Sourcepub fn find_attendee(&self, email: &str) -> Option<&Attendee>
pub fn find_attendee(&self, email: &str) -> Option<&Attendee>
Find the attendee matching the given email (case-insensitive)
pub fn set_attendee_status( &mut self, email: &str, status: ParticipationStatus, ) -> Result<(), EventError>
pub fn is_pending_invite_for(&self, email: &str) -> bool
Sourcepub fn with_new_uid(&self) -> Self
pub fn with_new_uid(&self) -> Self
Return a clone of this event with a fresh UID.
Sourcepub fn x_property(&self, name: &str) -> Option<&str>
pub fn x_property(&self, name: &str) -> Option<&str>
Find the first x-property value matching the given name.
pub fn event_instance_id(&self) -> EventInstanceId
Sourcepub fn with_x_properties_merged_from(self, base: &Event) -> Self
pub fn with_x_properties_merged_from(self, base: &Event) -> Self
Make sure local copy doesn’t strip provider-managed metadata from remote
Trait Implementations§
impl Eq for Event
Source§impl PartialEq for Eventwhere
EventUid: PartialEq,
Option<String>: PartialEq,
EventTime: PartialEq,
Option<EventTime>: PartialEq,
Status: PartialEq,
Availability: PartialEq,
Option<Visibility>: PartialEq,
Option<Recurrence>: PartialEq,
Option<RecurrenceId>: PartialEq,
Option<Organizer>: PartialEq,
Vec<Attendee>: PartialEq,
Vec<Reminder>: PartialEq,
impl PartialEq for Eventwhere
EventUid: PartialEq,
Option<String>: PartialEq,
EventTime: PartialEq,
Option<EventTime>: PartialEq,
Status: PartialEq,
Availability: PartialEq,
Option<Visibility>: PartialEq,
Option<Recurrence>: PartialEq,
Option<RecurrenceId>: PartialEq,
Option<Organizer>: PartialEq,
Vec<Attendee>: PartialEq,
Vec<Reminder>: PartialEq,
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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
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
key and return true if they are equal.