Struct ics::components::Component
source · pub struct Component<'a> { /* private fields */ }
Expand description
A Component
contains properties and sometimes sub-components.
This can be used to create a new calendar component by either creating a wrapper type or just use it as it is.
Implementations§
source§impl<'a> Component<'a>
impl<'a> Component<'a>
sourcepub fn new<S>(name: S) -> Selfwhere
S: Into<Cow<'a, str>>,
pub fn new<S>(name: S) -> Selfwhere
S: Into<Cow<'a, str>>,
Creates a new component with the given name.
sourcepub fn add_property<P>(&mut self, property: P)where
P: Into<Property<'a>>,
pub fn add_property<P>(&mut self, property: P)where
P: Into<Property<'a>>,
Adds a property to a component. Some properties can be added multiple times. Each occurrence will be shown as single content line.
sourcepub fn add_component<C>(&mut self, component: C)where
C: Into<Component<'a>>,
pub fn add_component<C>(&mut self, component: C)where
C: Into<Component<'a>>,
Adds a sub-component to this component.
Trait Implementations§
source§impl<'a> Ord for Component<'a>
impl<'a> Ord for Component<'a>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq<Component<'a>> for Component<'a>
impl<'a> PartialEq<Component<'a>> for Component<'a>
source§impl<'a> PartialOrd<Component<'a>> for Component<'a>
impl<'a> PartialOrd<Component<'a>> for Component<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more