Struct atom_syndication::Generator
source · pub struct Generator {
pub value: String,
pub uri: Option<String>,
pub version: Option<String>,
}
Expand description
Represents the generator of an Atom feed
Fields§
§value: String
The 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());
Trait Implementations§
source§impl PartialEq<Generator> for Generator
impl PartialEq<Generator> for Generator
impl StructuralPartialEq for Generator
Auto Trait Implementations§
impl RefUnwindSafe for Generator
impl Send for Generator
impl Sync for Generator
impl Unpin for Generator
impl UnwindSafe for Generator
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more