[][src]Struct atom_syndication::Source

pub struct Source {
    pub title: String,
    pub id: String,
    pub updated: FixedDateTime,
    pub authors: Vec<Person>,
    pub categories: Vec<Category>,
    pub contributors: Vec<Person>,
    pub generator: Option<Generator>,
    pub icon: Option<String>,
    pub links: Vec<Link>,
    pub logo: Option<String>,
    pub rights: Option<String>,
    pub subtitle: Option<String>,
}

Represents the source of an Atom entry

Fields

title: String

A human-readable title for the feed.

id: String

A universally unique and permanent URI.

updated: FixedDateTime

The last time the feed was modified in a significant way.

authors: Vec<Person>

The authors of the feed.

categories: Vec<Category>

The categories that the feed belongs to.

contributors: Vec<Person>

The contributors to the feed.

generator: Option<Generator>

The software used to generate the feed.

icon: Option<String>

A small image which provides visual identification for the feed.

links: Vec<Link>

The Web pages related to the feed.

A larger image which provides visual identification for the feed.

rights: Option<String>

Information about rights held in and over the feed.

subtitle: Option<String>

A human-readable description or subtitle for the feed.

Implementations

impl Source[src]

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

Return the title of the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_title("Feed Title");
assert_eq!(source.title(), "Feed Title");

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

Set the title of the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_title("Feed Title");

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

Return the unique URI of the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_id("urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6");
assert_eq!(source.id(), "urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6");

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

Set the unique URI of the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_id("urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6");

pub fn updated(&self) -> &FixedDateTime[src]

Return the last time that the source feed was modified.

Examples

use atom_syndication::Source;
use atom_syndication::FixedDateTime;
use std::str::FromStr;

let mut source = Source::default();
source.set_updated(FixedDateTime::from_str("2017-06-03T15:15:44-05:00").unwrap());
assert_eq!(source.updated().to_rfc3339(), "2017-06-03T15:15:44-05:00");

pub fn set_updated<V>(&mut self, updated: V) where
    V: Into<FixedDateTime>, 
[src]

Set the last time that the source feed was modified.

Examples

use atom_syndication::Source;
use atom_syndication::FixedDateTime;
use std::str::FromStr;

let mut source = Source::default();
source.set_updated(FixedDateTime::from_str("2017-06-03T15:15:44-05:00").unwrap());

pub fn authors(&self) -> &[Person][src]

Return the authors of the source feed.

Examples

use atom_syndication::{Source, Person};

let mut source = Source::default();
source.set_authors(vec![Person::default()]);
assert_eq!(source.authors().len(), 1);

pub fn set_authors<V>(&mut self, authors: V) where
    V: Into<Vec<Person>>, 
[src]

Set the authors of the source feed.

Examples

use atom_syndication::{Source, Person};

let mut source = Source::default();
source.set_authors(vec![Person::default()]);

pub fn categories(&self) -> &[Category][src]

Return the categories the source feed belongs to.

Examples

use atom_syndication::{Source, Category};

let mut source = Source::default();
source.set_categories(vec![Category::default()]);
assert_eq!(source.categories().len(), 1);

pub fn set_categories<V>(&mut self, categories: V) where
    V: Into<Vec<Category>>, 
[src]

Set the categories the source feed belongs to.

Examples

use atom_syndication::{Source, Category};

let mut source = Source::default();
source.set_categories(vec![Category::default()]);

pub fn contributors(&self) -> &[Person][src]

Return the contributors to the source feed.

Examples

use atom_syndication::{Source, Person};

let mut source = Source::default();
source.set_contributors(vec![Person::default()]);
assert_eq!(source.contributors().len(), 1);

pub fn set_contributors<V>(&mut self, contributors: V) where
    V: Into<Vec<Person>>, 
[src]

Set the contributors to the source feed.

Examples

use atom_syndication::{Source, Person};

let mut source = Source::default();
source.set_contributors(vec![Person::default()]);

pub fn generator(&self) -> Option<&Generator>[src]

Return the name of the software used to generate the source feed.

Examples

use atom_syndication::{Source, Generator};

let mut source = Source::default();
source.set_generator(Generator::default());
assert!(source.generator().is_some());

pub fn set_generator<V>(&mut self, generator: V) where
    V: Into<Option<Generator>>, 
[src]

Set the name of the software used to generate the source feed.

Examples

use atom_syndication::{Source, Generator};

let mut source = Source::default();
source.set_generator(Generator::default());

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

Return the icon for the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_icon("http://example.com/icon.png".to_string());
assert_eq!(source.icon(), Some("http://example.com/icon.png"));

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

Set the icon for the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_icon("http://example.com/icon.png".to_string());

Return the Web pages related to the source feed.

Examples

use atom_syndication::{Source, Link};

let mut source = Source::default();
source.set_links(vec![Link::default()]);
assert_eq!(source.links().len(), 1);

Set the Web pages related to the source feed.

Examples

use atom_syndication::{Source, Link};

let mut source = Source::default();
source.set_links(vec![Link::default()]);

Return the logo for the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_logo("http://example.com/logo.png".to_string());
assert_eq!(source.logo(), Some("http://example.com/logo.png"));

Set the logo for the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_logo("http://example.com/logo.png".to_string());

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

Return the information about the rights held in and over the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_rights("© 2017 John Doe".to_string());
assert_eq!(source.rights(), Some("© 2017 John Doe"));

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

Set the information about the rights held in and over the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_rights("© 2017 John Doe".to_string());

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

Return the description or subtitle of the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_subtitle("Feed subtitle".to_string());
assert_eq!(source.subtitle(), Some("Feed subtitle"));

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

Set the description or subtitle of the source feed.

Examples

use atom_syndication::Source;

let mut source = Source::default();
source.set_subtitle("Feed subtitle".to_string());

Trait Implementations

impl Clone for Source[src]

impl Debug for Source[src]

impl Default for Source[src]

impl PartialEq<Source> for Source[src]

impl StructuralPartialEq for Source[src]

Auto Trait Implementations

impl RefUnwindSafe for Source

impl Send for Source

impl Sync for Source

impl Unpin for Source

impl UnwindSafe for Source

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.