Struct atom_syndication::Generator
source · Expand description
Represents the generator of an Atom feed
Fields§
§value: StringThe name of the generator.
uri: Option<String>The generator URI.
version: Option<String>The generator version.
Implementations§
source§impl Generator
impl Generator
sourcepub fn value(&self) -> &str
pub fn value(&self) -> &str
Return the name of the generator.
Examples
use atom_syndication::Generator;
let mut generator = Generator::default();
generator.set_value("Feed Generator");
assert_eq!(generator.value(), "Feed Generator");sourcepub fn set_value<V>(&mut self, value: V)where
V: Into<String>,
pub fn set_value<V>(&mut self, value: V)where
V: Into<String>,
Set the name of the generator.
Examples
use atom_syndication::Generator;
let mut generator = Generator::default();
generator.set_value("Feed Generator");
assert_eq!(generator.value(), "Feed Generator");sourcepub fn uri(&self) -> Option<&str>
pub fn uri(&self) -> Option<&str>
Return the URI for the generator.
Examples
use atom_syndication::Generator;
let mut generator = Generator::default();
generator.set_uri("http://example.com/generator".to_string());
assert_eq!(generator.uri(), Some("http://example.com/generator"));sourcepub fn set_uri<V>(&mut self, uri: V)where
V: Into<Option<String>>,
pub fn set_uri<V>(&mut self, uri: V)where
V: Into<Option<String>>,
Set the URI for the generator.
Examples
use atom_syndication::Generator;
let mut generator = Generator::default();
generator.set_uri("http://example.com/generator".to_string());