pub struct Component {
pub name: String,
pub props: BTreeMap<String, Vec<Property>>,
pub subcomponents: Vec<Component>,
}Fields§
§name: StringThe name of the component, such as VCARD or VEVENT.
props: BTreeMap<String, Vec<Property>>The component’s properties.
subcomponents: Vec<Component>The component’s child- or sub-components.
Implementations§
Source§impl Component
impl Component
pub fn new<N: Into<String>>(name: N) -> Component
Sourcepub fn push(&mut self, prop: Property)
pub fn push(&mut self, prop: Property)
Append the given property, preserve other same-named properties.
Sourcepub fn set(&mut self, prop: Property)
pub fn set(&mut self, prop: Property)
Set the given property, remove other same-named properties.
Sourcepub fn get_only<P: AsRef<str>>(&self, name: P) -> Option<&Property>
pub fn get_only<P: AsRef<str>>(&self, name: P) -> Option<&Property>
Retrieve one property by key. Returns None if not exactly one property was found.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnwindSafe for Component
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
Mutably borrows from an owned value. Read more