pub trait Component {
Show 21 methods
fn component_kind() -> &'static str;
fn properties(&self) -> &HashMap<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 fmt_write<W: Write>(&self, out: &mut W) -> Result<(), Error> { ... }
fn to_string(&self) -> String { ... }
fn add_property(&mut self, key: &str, val: &str) -> &mut Self { ... }
fn add_multi_property(&mut self, key: &str, val: &str) -> &mut Self { ... }
fn starts<TZ: TimeZone>(&mut self, dt: DateTime<TZ>) -> &mut Self
where
TZ::Offset: Display,
{ ... }
fn ends<TZ: TimeZone>(&mut self, dt: DateTime<TZ>) -> &mut Self
where
TZ::Offset: Display,
{ ... }
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 print(&self) -> Result<(), Error> { ... }
fn summary(&mut self, desc: &str) -> &mut Self { ... }
fn description(&mut self, desc: &str) -> &mut Self { ... }
fn location(&mut self, location: &str) -> &mut Self { ... }
fn uid(&mut self, uid: &str) -> &mut Self { ... }
fn class(&mut self, class: Class) -> &mut Self { ... }
}
Expand description
Implemented by everything that goes into a Calendar
Required Methods
sourcefn component_kind() -> &'static str
fn component_kind() -> &'static str
Returns kind of component.
Must be ALL CAPS
These are used in the BEGIN
and END
line of the component.
sourcefn properties(&self) -> &HashMap<String, Property>
fn properties(&self) -> &HashMap<String, Property>
Allows access to the inner properties HashMap.
sourcefn multi_properties(&self) -> &Vec<Property>
fn multi_properties(&self) -> &Vec<Property>
Read-only access to multi_properties
sourcefn append_property(&mut self, property: Property) -> &mut Self
fn append_property(&mut self, property: Property) -> &mut Self
Append a given Property
sourcefn 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
sourcefn fmt_write<W: Write>(&self, out: &mut W) -> Result<(), Error>
fn fmt_write<W: Write>(&self, out: &mut W) -> Result<(), Error>
Writes Component
into a Writer
using std::fmt
.
sourcefn add_property(&mut self, key: &str, val: &str) -> &mut Self
fn add_property(&mut self, key: &str, val: &str) -> &mut Self
Construct and append a Property
sourcefn 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
sourcefn starts<TZ: TimeZone>(&mut self, dt: DateTime<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
fn starts<TZ: TimeZone>(&mut self, dt: DateTime<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
Set the DTSTART Property
sourcefn ends<TZ: TimeZone>(&mut self, dt: DateTime<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
fn ends<TZ: TimeZone>(&mut self, dt: DateTime<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
Set the DTEND Property
sourcefn start_date<TZ: TimeZone>(&mut self, date: Date<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
fn start_date<TZ: TimeZone>(&mut self, date: Date<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
Set the DTSTART Property
, date only
sourcefn end_date<TZ: TimeZone>(&mut self, date: Date<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
fn end_date<TZ: TimeZone>(&mut self, date: Date<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
Set the DTEND Property
, date only
sourcefn all_day<TZ: TimeZone>(&mut self, date: Date<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
fn all_day<TZ: TimeZone>(&mut self, date: Date<TZ>) -> &mut Selfwhere
TZ::Offset: Display,
Set the DTSTART Property
, date only
sourcefn priority(&mut self, priority: u32) -> &mut Self
fn priority(&mut self, priority: u32) -> &mut Self
Defines the relative priority.
Ranges from 0 to 10, larger values will be truncated
sourcefn description(&mut self, desc: &str) -> &mut Self
fn description(&mut self, desc: &str) -> &mut Self
Set the description