Struct atom_syndication::extension::Extension [] [src]

pub struct Extension { /* fields omitted */ }

A namespaced extension.

Methods

impl Extension
[src]

[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");

[src]

Set the qualified name of this extension.

Examples

use atom_syndication::extension::Extension;

let mut extension = Extension::default();
extension.set_name("ext:name");

[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"));

[src]

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());

[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);

[src]

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());

[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"));

[src]

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]

[src]

Formats the value using the given formatter.

impl Default for Extension
[src]

[src]

Returns the "default value" for a type. Read more

impl Clone for Extension
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Extension
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.