pub trait Component {
Show 34 methods
fn component_kind(&self) -> String;
fn properties(&self) -> &BTreeMap<String, Property>;
fn multi_properties(&self) -> &Vec<Property>;
fn append_property(&mut self, property: Property) -> &mut Self;
fn append_multi_property(&mut self, property: Property) -> &mut Self;
fn property_value(&self, key: &str) -> Option<&str> { ... }
fn fmt_write<W: Write>(&self, out: &mut W) -> Result<(), Error> { ... }
fn to_string(&self) -> String { ... }
fn try_into_string(&self) -> Result<String, Error> { ... }
fn add_property(&mut self, key: &str, val: &str) -> &mut Self { ... }
fn add_multi_property(&mut self, key: &str, val: &str) -> &mut Self { ... }
fn timestamp<T: Into<CalendarDateTime>>(&mut self, dt: T) -> &mut Self { ... }
fn get_timestamp(&self) -> Option<CalendarDateTime> { ... }
fn get_start(&self) -> Option<DatePerhapsTime> { ... }
fn get_end(&self) -> Option<DatePerhapsTime> { ... }
fn starts<T: Into<CalendarDateTime>>(&mut self, dt: T) -> &mut Self { ... }
fn ends<T: Into<CalendarDateTime>>(&mut self, dt: T) -> &mut Self { ... }
fn start_date<TZ: TimeZone>(&mut self, date: Date<TZ>) -> &mut Self
where
TZ::Offset: Display,
{ ... }
fn end_date<TZ: TimeZone>(&mut self, date: Date<TZ>) -> &mut Self
where
TZ::Offset: Display,
{ ... }
fn all_day<TZ: TimeZone>(&mut self, date: Date<TZ>) -> &mut Self
where
TZ::Offset: Display,
{ ... }
fn priority(&mut self, priority: u32) -> &mut Self { ... }
fn get_priority(&self) -> Option<u32> { ... }
fn print(&self) -> Result<(), Error> { ... }
fn summary(&mut self, desc: &str) -> &mut Self { ... }
fn get_summary(&self) -> Option<&str> { ... }
fn description(&mut self, desc: &str) -> &mut Self { ... }
fn get_description(&self) -> Option<&str> { ... }
fn location(&mut self, location: &str) -> &mut Self { ... }
fn get_location(&self) -> Option<&str> { ... }
fn venue(&mut self, location: &str, venue_uid: &str) -> &mut Self { ... }
fn uid(&mut self, uid: &str) -> &mut Self { ... }
fn get_uid(&self) -> Option<&str> { ... }
fn class(&mut self, class: Class) -> &mut Self { ... }
fn get_class(&self) -> Option<Class> { ... }
}
Expand description
Implemented by everything that goes into a Calendar
Required methods
fn component_kind(&self) -> String
fn component_kind(&self) -> String
Returns kind of component.
Must be ALL CAPS
These are used in the BEGIN
and END
line of the component.
fn properties(&self) -> &BTreeMap<String, Property>
fn properties(&self) -> &BTreeMap<String, Property>
Allows access to the inner properties map.
fn multi_properties(&self) -> &Vec<Property>
fn multi_properties(&self) -> &Vec<Property>
Read-only access to multi_properties
fn append_property(&mut self, property: Property) -> &mut Self
fn append_property(&mut self, property: Property) -> &mut Self
Append a given Property
fn append_multi_property(&mut self, property: Property) -> &mut Self
fn append_multi_property(&mut self, property: Property) -> &mut Self
Adds a Property
of which there may be many
Provided methods
fn property_value(&self, key: &str) -> Option<&str>
fn property_value(&self, key: &str) -> Option<&str>
Gets the value of a property.
Serializes this component into rfc5545
again
Panic
this can panic if std::fmt::write
returns an Error
use Component::try_into_string()
if you don’t like panicking
fn try_into_string(&self) -> Result<String, Error>
fn try_into_string(&self) -> Result<String, Error>
Serializes this component into rfc5545
again
fn add_multi_property(&mut self, key: &str, val: &str) -> &mut Self
fn add_multi_property(&mut self, key: &str, val: &str) -> &mut Self
Construct and append a Property
fn timestamp<T: Into<CalendarDateTime>>(&mut self, dt: T) -> &mut Self
fn timestamp<T: Into<CalendarDateTime>>(&mut self, dt: T) -> &mut Self
See CalendarDateTime
for info how are different chrono
types converted automatically.
fn get_timestamp(&self) -> Option<CalendarDateTime>
fn get_timestamp(&self) -> Option<CalendarDateTime>
Gets the DTSTAMP
property.
fn starts<T: Into<CalendarDateTime>>(&mut self, dt: T) -> &mut Self
fn starts<T: Into<CalendarDateTime>>(&mut self, dt: T) -> &mut Self
See CalendarDateTime
for info how are different chrono
types converted automatically.
fn ends<T: Into<CalendarDateTime>>(&mut self, dt: T) -> &mut Self
fn ends<T: Into<CalendarDateTime>>(&mut self, dt: T) -> &mut Self
See CalendarDateTime
for info how are different chrono
types converted automatically.
Defines the relative priority.
Ranges from 0 to 10, larger values will be truncated
fn get_priority(&self) -> Option<u32>
fn get_priority(&self) -> Option<u32>
Gets the relative priority.
Ranges from 0 to 10.
fn get_summary(&self) -> Option<&str>
fn get_summary(&self) -> Option<&str>
Gets the summary
fn description(&mut self, desc: &str) -> &mut Self
fn description(&mut self, desc: &str) -> &mut Self
Set the description
fn get_description(&self) -> Option<&str>
fn get_description(&self) -> Option<&str>
Gets the description
fn get_location(&self) -> Option<&str>
fn get_location(&self) -> Option<&str>
Gets the location
Set the LOCATION with a VVENUE UID iCalender venue draft