Struct atom_syndication::Category
source · pub struct Category {
pub term: String,
pub scheme: Option<String>,
pub label: Option<String>,
}
Expand description
Represents a category in an Atom feed
Fields§
§term: String
Identifies 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)
pub fn set_term<V>(&mut self, term: V)
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)
pub fn set_scheme<V>(&mut self, scheme: V)
Set the categorization scheme URI.
§Examples
use atom_syndication::Category;
let mut category = Category::default();
category.set_scheme("http://example.com/scheme".to_string());
Trait Implementations§
impl StructuralPartialEq for Category
Auto Trait Implementations§
impl Freeze for Category
impl RefUnwindSafe for Category
impl Send for Category
impl Sync for Category
impl Unpin for Category
impl UnwindSafe for Category
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)