Struct vobject::component::Component
[−]
[src]
pub struct Component { pub name: String, pub props: BTreeMap<String, Vec<Property>>, pub subcomponents: Vec<Component>, }
Fields
name: String
The 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.
Methods
impl Component
[src]
pub fn new<N: Into<String>>(name: N) -> Component
[src]
pub fn push(&mut self, prop: Property)
[src]
Append the given property, preserve other same-named properties.
pub fn set(&mut self, prop: Property)
[src]
Set the given property, remove other same-named properties.
pub fn get_only<P: AsRef<str>>(&self, name: P) -> Option<&Property>
[src]
Retrieve one property by key. Returns None
if not exactly one property was found.
pub fn get_all<P: AsRef<str>>(&self, name: P) -> &[Property]
[src]
Retrieve properties by key. Returns an empty slice if key doesn't exist.
pub fn pop<P: AsRef<str>>(&mut self, name: P) -> Option<Property>
[src]
Remove a single property.
pub fn remove<P: AsRef<str>>(&mut self, name: P) -> Option<Vec<Property>>
[src]
Remove all properties
Trait Implementations
impl Clone for Component
[src]
fn clone(&self) -> Component
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Component
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more