[][src]Struct atom_syndication::Entry

pub struct Entry {
    pub title: String,
    pub id: String,
    pub updated: FixedDateTime,
    pub authors: Vec<Person>,
    pub categories: Vec<Category>,
    pub contributors: Vec<Person>,
    pub links: Vec<Link>,
    pub published: Option<FixedDateTime>,
    pub rights: Option<String>,
    pub source: Option<Source>,
    pub summary: Option<String>,
    pub content: Option<Content>,
    pub extensions: ExtensionMap,
}

Represents an entry in an Atom feed

Fields

title: String

A human-readable title for the entry.

id: String

A universally unique and permanent URI.

updated: FixedDateTime

The last time the entry was modified.

authors: Vec<Person>

The authors of the feed.

categories: Vec<Category>

The categories that the entry belongs to.

contributors: Vec<Person>

The contributors to the entry.

links: Vec<Link>

The Web pages related to the entry.

published: Option<FixedDateTime>

The time of the initial creation or first availability of the entry.

rights: Option<String>

Information about rights held in and over the entry.

source: Option<Source>

The source information if an entry is copied from one feed into another feed.

summary: Option<String>

A short summary, abstract, or excerpt of the entry.

content: Option<Content>

Contains or links to the complete content of the entry.

extensions: ExtensionMap

The extensions for this entry.

Implementations

impl Entry[src]

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

Return the title of this entry.

Examples

use atom_syndication::Entry;

let mut entry = Entry::default();
entry.set_title("Entry Title");
assert_eq!(entry.title(), "Entry Title");

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

Set the title of this entry.

Examples

use atom_syndication::Entry;

let mut entry = Entry::default();
entry.set_title("Entry Title");

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

Return the unique URI of this entry.

Examples

use atom_syndication::Entry;

let mut entry = Entry::default();
entry.set_id("urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6");
assert_eq!(entry.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 this entry.

Examples

use atom_syndication::Entry;

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

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

Return the last time that this entry was modified.

Examples

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

let mut entry = Entry::default();
entry.set_updated(FixedDateTime::from_str("2017-06-03T15:15:44-05:00").unwrap());
assert_eq!(entry.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 this entry was modified.

Examples

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

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

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

Return the authors of this entry.

Examples

use atom_syndication::{Entry, Person};

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

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

Set the authors of this entry.

Examples

use atom_syndication::{Entry, Person};

let mut entry = Entry::default();
entry.set_authors(vec![Person::default()]);

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

Return the categories this entry belongs to.

Examples

use atom_syndication::{Entry, Category};

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

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

Set the categories this entry belongs to.

Examples

use atom_syndication::{Entry, Category};

let mut entry = Entry::default();
entry.set_categories(vec![Category::default()]);

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

Return the contributors to this entry.

Examples

use atom_syndication::{Entry, Person};

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

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

Set the contributors to this entry.

Examples

use atom_syndication::{Entry, Person};

let mut entry = Entry::default();
entry.set_contributors(vec![Person::default()]);

Return the links for this entry.

Examples

use atom_syndication::{Entry, Link};

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

Set the links for this entry.

Examples

use atom_syndication::{Entry, Link};

let mut entry = Entry::default();
entry.set_links(vec![Link::default()]);

pub fn published(&self) -> Option<&FixedDateTime>[src]

Return the time that this entry was initially created or first made available.

Examples

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

let mut entry = Entry::default();
entry.set_published(FixedDateTime::from_str("2017-06-01T15:15:44-05:00").unwrap());
assert_eq!(entry.published().map(|x|x.to_rfc3339()), Some("2017-06-01T15:15:44-05:00".to_string()));

pub fn set_published<V>(&mut self, published: V) where
    V: Into<Option<FixedDateTime>>, 
[src]

Set the time that this entry was initially created or first made available.

Examples

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

let mut entry = Entry::default();
entry.set_published(FixedDateTime::from_str("2017-06-01T15:15:44-05:00").unwrap());

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

Return the information about the rights held in and over this entry.

Examples

use atom_syndication::Entry;

let mut entry = Entry::default();
entry.set_rights("© 2017 John Doe".to_string());
assert_eq!(entry.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 this entry.

Examples

use atom_syndication::Entry;

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

pub fn source(&self) -> Option<&Source>[src]

Return the source of this entry if it was copied from another feed.

Examples

use atom_syndication::{Entry, Source};

let mut entry = Entry::default();
entry.set_source(Source::default());
assert!(entry.source().is_some());

pub fn set_source<V>(&mut self, source: V) where
    V: Into<Option<Source>>, 
[src]

Set the source of this entry if it was copied from another feed.

Examples

use atom_syndication::{Entry, Source};

let mut entry = Entry::default();
entry.set_source(Source::default());

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

Return the summary of this entry.

Examples

use atom_syndication::Entry;

let mut entry = Entry::default();
entry.set_summary("Entry summary.".to_string());
assert_eq!(entry.summary(), Some("Entry summary."));

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

Set the summary of this entry.

Examples

use atom_syndication::Entry;

let mut entry = Entry::default();
entry.set_summary("Entry summary.".to_string());

pub fn content(&self) -> Option<&Content>[src]

Return the content of this entry.

Examples

use atom_syndication::{Entry, Content};

let mut entry = Entry::default();
entry.set_content(Content::default());
assert!(entry.content().is_some());

pub fn set_content<V>(&mut self, content: V) where
    V: Into<Option<Content>>, 
[src]

Set the content of this entry.

Examples

use atom_syndication::{Entry, Content};

let mut entry = Entry::default();
entry.set_content(Content::default());
assert!(entry.content().is_some());

pub fn extensions(&self) -> &ExtensionMap[src]

Return the extensions for this entry.

Examples

use std::collections::HashMap;
use atom_syndication::Entry;
use atom_syndication::extension::{ExtensionMap, Extension};

let extension = Extension::default();

let mut item_map = HashMap::<String, Vec<Extension>>::new();
item_map.insert("ext:name".to_string(), vec![extension]);

let mut extension_map = ExtensionMap::default();
extension_map.insert("ext".to_string(), item_map);

let mut entry = Entry::default();
entry.set_extensions(extension_map);
assert_eq!(entry.extensions()
                .get("ext")
                .and_then(|m| m.get("ext:name"))
                .map(|v| v.len()),
           Some(1));

pub fn set_extensions<V>(&mut self, extensions: V) where
    V: Into<ExtensionMap>, 
[src]

Set the extensions for this entry.

Examples

use atom_syndication::Entry;
use atom_syndication::extension::ExtensionMap;

let mut entry = Entry::default();
entry.set_extensions(ExtensionMap::default());

Trait Implementations

impl Clone for Entry[src]

impl Debug for Entry[src]

impl Default for Entry[src]

impl PartialEq<Entry> for Entry[src]

impl StructuralPartialEq for Entry[src]

Auto Trait Implementations

impl RefUnwindSafe for Entry

impl Send for Entry

impl Sync for Entry

impl Unpin for Entry

impl UnwindSafe for Entry

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.