Struct atom_syndication::Category
source · Expand description
Represents a category in an Atom feed
Fields§
§term: StringIdentifies the category.
scheme: Option<String>Identifies the categorization scheme via a URI.
label: Option<String>A human-readable label for display.
Implementations§
source§impl Category
impl Category
sourcepub fn term(&self) -> &str
pub fn term(&self) -> &str
Return the term that identifies this category.
Examples
use atom_syndication::Category;
let mut category = Category::default();
category.set_term("technology");
assert_eq!(category.term(), "technology");sourcepub fn set_term<V>(&mut self, term: V)where
V: Into<String>,
pub fn set_term<V>(&mut self, term: V)where
V: Into<String>,
Set the term that identifies this category.
Examples
use atom_syndication::Category;
let mut category = Category::default();
category.set_term("technology");sourcepub fn scheme(&self) -> Option<&str>
pub fn scheme(&self) -> Option<&str>
Return the categorization scheme URI.
Examples
use atom_syndication::Category;
let mut category = Category::default();
category.set_scheme("http://example.com/scheme".to_string());
assert_eq!(category.scheme(), Some("http://example.com/scheme"));sourcepub fn set_scheme<V>(&mut self, scheme: V)where
V: Into<Option<String>>,
pub fn set_scheme<V>(&mut self, scheme: V)where
V: Into<Option<String>>,
Set the categorization scheme URI.
Examples
use atom_syndication::Category;
let mut category = Category::default();
category.set_scheme("http://example.com/scheme".to_string());