icalendar

Trait Component

Source
pub trait Component {
Show 37 methods // Required methods fn component_kind(&self) -> String; fn properties(&self) -> &BTreeMap<String, Property>; fn components(&self) -> &[Other]; fn multi_properties(&self) -> &BTreeMap<String, Vec<Property>>; fn append_property(&mut self, property: impl Into<Property>) -> &mut Self; fn append_component(&mut self, child: impl Into<Other>) -> &mut Self; fn append_multi_property( &mut self, property: impl Into<Property>, ) -> &mut Self; // Provided methods 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: impl Into<String>, val: impl Into<String>, ) -> &mut Self { ... } fn add_property_pre_alloc(&mut self, key: String, val: String) -> &mut Self { ... } fn add_multi_property(&mut self, key: &str, val: &str) -> &mut Self { ... } fn timestamp(&mut self, dt: DateTime<Utc>) -> &mut Self { ... } fn get_timestamp(&self) -> Option<DateTime<Utc>> { ... } fn get_start(&self) -> Option<DatePerhapsTime> { ... } fn get_end(&self) -> Option<DatePerhapsTime> { ... } 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 uid(&mut self, uid: &str) -> &mut Self { ... } fn get_uid(&self) -> Option<&str> { ... } fn sequence(&mut self, sequence: u32) -> &mut Self { ... } fn get_sequence(&self) -> Option<u32> { ... } fn class(&mut self, class: Class) -> &mut Self { ... } fn get_class(&self) -> Option<Class> { ... } fn url(&mut self, url: &str) -> &mut Self { ... } fn get_url(&self) -> Option<&str> { ... } fn last_modified(&mut self, dt: DateTime<Utc>) -> &mut Self { ... } fn get_last_modified(&self) -> Option<DateTime<Utc>> { ... } fn created(&mut self, dt: DateTime<Utc>) -> &mut Self { ... } fn get_created(&self) -> Option<DateTime<Utc>> { ... }
}
Expand description

Implemented by everything that goes into a Calendar

Required Methods§

Source

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.

Source

fn properties(&self) -> &BTreeMap<String, Property>

Allows access to the inner properties map.

Source

fn components(&self) -> &[Other]

Allows access to the inner’s child components.

Source

fn multi_properties(&self) -> &BTreeMap<String, Vec<Property>>

Read-only access to multi_properties

Source

fn append_property(&mut self, property: impl Into<Property>) -> &mut Self

Append a given Property

Source

fn append_component(&mut self, child: impl Into<Other>) -> &mut Self

Append a given Component

Source

fn append_multi_property(&mut self, property: impl Into<Property>) -> &mut Self

Adds a Property of which there may be many

Provided Methods§

Source

fn property_value(&self, key: &str) -> Option<&str>

Gets the value of a property.

Source

fn fmt_write<W: Write>(&self, out: &mut W) -> Result<(), Error>

Writes Component using std::fmt.

Source

fn to_string(&self) -> String

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

Source

fn try_into_string(&self) -> Result<String, Error>

Serializes this component into rfc5545 again

Source

fn add_property( &mut self, key: impl Into<String>, val: impl Into<String>, ) -> &mut Self

Construct and append a Property

Source

fn add_property_pre_alloc(&mut self, key: String, val: String) -> &mut Self

👎Deprecated

Construct and append a Property

Source

fn add_multi_property(&mut self, key: &str, val: &str) -> &mut Self

Construct and append a Property

Source

fn timestamp(&mut self, dt: DateTime<Utc>) -> &mut Self

Set the DTSTAMP Property

This must be a UTC date-time value.

Source

fn get_timestamp(&self) -> Option<DateTime<Utc>>

Gets the DTSTAMP property.

Source

fn get_start(&self) -> Option<DatePerhapsTime>

Gets the DTSTART Property

Source

fn get_end(&self) -> Option<DatePerhapsTime>

Gets the DTEND Property

Source

fn priority(&mut self, priority: u32) -> &mut Self

Defines the relative priority.

Ranges from 0 to 10, larger values will be truncated

Source

fn get_priority(&self) -> Option<u32>

Gets the relative priority.

Ranges from 0 to 10.

Source

fn print(&self) -> Result<(), Error>

Prints to stdout

Source

fn summary(&mut self, desc: &str) -> &mut Self

Set the summary

Source

fn get_summary(&self) -> Option<&str>

Gets the summary

Source

fn description(&mut self, desc: &str) -> &mut Self

Set the description

Source

fn get_description(&self) -> Option<&str>

Gets the description

Source

fn uid(&mut self, uid: &str) -> &mut Self

Set the UID

Source

fn get_uid(&self) -> Option<&str>

Gets the UID

Source

fn sequence(&mut self, sequence: u32) -> &mut Self

Set the sequence

Source

fn get_sequence(&self) -> Option<u32>

Gets the SEQUENCE

Source

fn class(&mut self, class: Class) -> &mut Self

Set the visibility class

Source

fn get_class(&self) -> Option<Class>

Gets the visibility class

Source

fn url(&mut self, url: &str) -> &mut Self

Sets the URL.

Source

fn get_url(&self) -> Option<&str>

Gets the URL.

Source

fn last_modified(&mut self, dt: DateTime<Utc>) -> &mut Self

Set the LAST_MODIFIED Property

This must be a UTC date-time value.

Source

fn get_last_modified(&self) -> Option<DateTime<Utc>>

Gets the LAST_MODIFIED property.

Source

fn created(&mut self, dt: DateTime<Utc>) -> &mut Self

Set the CREATED Property

This must be a UTC date-time value.

Source

fn get_created(&self) -> Option<DateTime<Utc>>

Gets the CREATED property.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§