Struct atom_syndication::extension::Extension
[−]
[src]
pub struct Extension { /* fields omitted */ }
A namespaced extension.
Methods
impl Extension
[src]
fn name(&self) -> &str
[src]
Return the qualified name of this extension.
Examples
use atom_syndication::extension::Extension; let mut extension = Extension::default(); extension.set_name("ext:name"); assert_eq!(extension.name(), "ext:name");
fn set_name<V>(&mut self, name: V) where
V: Into<String>,
[src]
V: Into<String>,
Set the qualified name of this extension.
Examples
use atom_syndication::extension::Extension; let mut extension = Extension::default(); extension.set_name("ext:name");
fn value(&self) -> Option<&str>
[src]
Return the text content of this extension.
Examples
use atom_syndication::extension::Extension; let mut extension = Extension::default(); extension.set_value("John Doe".to_string()); assert_eq!(extension.value(), Some("John Doe"));
fn set_value<V>(&mut self, value: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the text content of this extension.
Examples
use atom_syndication::extension::Extension; let mut extension = Extension::default(); extension.set_value("John Doe".to_string());
fn attrs(&self) -> &HashMap<String, String>
[src]
Return the attributes for the extension element.
Examples
use std::collections::HashMap; use atom_syndication::extension::Extension; let mut extension = Extension::default(); let mut attrs = HashMap::<String, String>::new(); attrs.insert("email".to_string(), "johndoe@example.com".to_string()); extension.set_attrs(attrs.clone()); assert_eq!(*extension.attrs(), attrs);
fn set_attrs<V>(&mut self, attrs: V) where
V: Into<HashMap<String, String>>,
[src]
V: Into<HashMap<String, String>>,
Set the attributes for the extension element.
Examples
use std::collections::HashMap; use atom_syndication::extension::Extension; let mut extension = Extension::default(); extension.set_attrs(HashMap::new());
fn children(&self) -> &HashMap<String, Vec<Extension>>
[src]
Return the children of the extension element.
A map of local names to child elements.
Examples
use std::collections::HashMap; use atom_syndication::extension::Extension; let mut extension = Extension::default(); let mut children = HashMap::<String, Vec<Extension>>::new(); children.insert("ext:child".to_string(), Vec::new()); extension.set_children(children); assert!(extension.children().contains_key("ext:child"));
fn set_children<V>(&mut self, children: V) where
V: Into<HashMap<String, Vec<Extension>>>,
[src]
V: Into<HashMap<String, Vec<Extension>>>,
Set the children of the extension element.
A map of local names to child elements.
Examples
use std::collections::HashMap; use atom_syndication::extension::Extension; let mut extension = Extension::default(); extension.set_children(HashMap::new());
Trait Implementations
impl Debug for Extension
[src]
impl Default for Extension
[src]
impl Clone for Extension
[src]
fn clone(&self) -> Extension
[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