[][src]Struct atom_syndication::Category

pub struct Category {
    pub term: String,
    pub scheme: Option<String>,
    pub label: Option<String>,
}

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

impl Category[src]

pub fn term(&self) -> &str[src]

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

pub fn set_term<V>(&mut self, term: V) where
    V: Into<String>, 
[src]

Set the term that identifies this category.

Examples

use atom_syndication::Category;

let mut category = Category::default();
category.set_term("technology");

pub fn scheme(&self) -> Option<&str>[src]

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

pub fn set_scheme<V>(&mut self, scheme: V) where
    V: Into<Option<String>>, 
[src]

Set the categorization scheme URI.

Examples

use atom_syndication::Category;

let mut category = Category::default();
category.set_scheme("http://example.com/scheme".to_string());

pub fn label(&self) -> Option<&str>[src]

Return the label for this category.

Examples

use atom_syndication::Category;

let mut category = Category::default();
category.set_scheme("Technology".to_string());
assert_eq!(category.scheme(), Some("Technology"));

pub fn set_label<V>(&mut self, label: V) where
    V: Into<Option<String>>, 
[src]

Set the label for this category.

Examples

use atom_syndication::Category;

let mut category = Category::default();
category.set_scheme("Technology".to_string());

Trait Implementations

impl Clone for Category[src]

impl Debug for Category[src]

impl Default for Category[src]

impl PartialEq<Category> for Category[src]

impl StructuralPartialEq for Category[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.