Struct vobject::Component
[−]
[src]
pub struct Component { pub name: String, pub props: HashMap<String, Vec<Property>>, pub subcomponents: Vec<Component>, }
Fields
name: String
The name of the component, such as VCARD
or VEVENT
.
props: HashMap<String, Vec<Property>>
The component's properties.
subcomponents: Vec<Component>
The component's child- or sub-components.
Methods
impl Component
[src]
fn new<N: Into<String>>(name: N) -> Component
fn push(&mut self, prop: Property)
Append the given property, preserve other same-named properties.
fn set(&mut self, prop: Property)
Set the given property, remove other same-named properties.
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.
fn get_all<P: AsRef<str>>(&self, name: P) -> &[Property]
Retrieve properties by key. Returns an empty slice if key doesn't exist.
fn pop<P: AsRef<str>>(&mut self, name: P) -> Option<Property>
Remove a single property.
fn remove<P: AsRef<str>>(&mut self, name: P) -> Option<Vec<Property>>
Remove all properties
Trait Implementations
impl Clone for Component
[src]
fn clone(&self) -> Component
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Component
[src]
impl FromStr for Component
[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> ParseResult<Component>
Same as vobject::parse_component