Struct atom_syndication::Feed [−][src]
pub struct Feed {Show fields
pub title: Text,
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<Text>,
pub subtitle: Option<Text>,
pub entries: Vec<Entry>,
pub extensions: ExtensionMap,
pub namespaces: BTreeMap<String, String>,
}Expand description
Represents an Atom feed
Fields
title: TextA human-readable title for the feed.
id: StringA universally unique and permanent URI.
updated: FixedDateTimeThe last time the feed was modified in a significant way.
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.
logo: Option<String>A larger image which provides visual identification for the feed.
rights: Option<Text>Information about rights held in and over the feed.
subtitle: Option<Text>A human-readable description or subtitle for the feed.
entries: Vec<Entry>The entries contained in the feed.
extensions: ExtensionMapThe extensions for the feed.
namespaces: BTreeMap<String, String>The namespaces present in the feed tag.
Implementations
Attempt to read an Atom feed from the reader.
Examples
use std::io::BufReader; use std::fs::File; use atom_syndication::Feed; let file = File::open("example.xml").unwrap(); let feed = Feed::read_from(BufReader::new(file)).unwrap();
Attempt to write this Atom feed to a writer.
Examples
use std::io::BufReader; use std::fs::File; use atom_syndication::Feed; let file = File::open("example.xml").unwrap(); let feed = Feed::read_from(BufReader::new(file)).unwrap(); let out = File::create("out.xml").unwrap(); feed.write_to(out).unwrap();
Return the title of this feed.
Examples
use atom_syndication::Feed; let mut feed = Feed::default(); feed.set_title("Feed Title"); assert_eq!(feed.title(), "Feed Title");
Set the title of this feed.
Examples
use atom_syndication::Feed; let mut feed = Feed::default(); feed.set_title("Feed Title");
Return the unique URI of this feed.
Examples
use atom_syndication::Feed; let mut feed = Feed::default(); feed.set_id("urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6"); assert_eq!(feed.id(), "urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6");
Set the unique URI of this feed.
Examples
use atom_syndication::Feed; let mut feed = Feed::default(); feed.set_id("urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6");
Return the last time that this feed was modified.
Examples
use atom_syndication::Feed; use atom_syndication::FixedDateTime; use std::str::FromStr; let mut feed = Feed::default(); feed.set_updated(FixedDateTime::from_str("2017-06-03T15:15:44-05:00").unwrap()); assert_eq!(feed.updated().to_rfc3339(), "2017-06-03T15:15:44-05:00");
Set the last time that this feed was modified.
Examples
use atom_syndication::Feed; use atom_syndication::FixedDateTime; use std::str::FromStr; let mut feed = Feed::default(); feed.set_updated(FixedDateTime::from_str("2017-06-03T15:15:44-05:00").unwrap());
Return the authors of this feed.
Examples
use atom_syndication::{Feed, Person}; let mut feed = Feed::default(); feed.set_authors(vec![Person::default()]); assert_eq!(feed.authors().len(), 1);
Set the authors of this feed.
Examples
use atom_syndication::{Feed, Person}; let mut feed = Feed::default(); feed.set_authors(vec![Person::default()]);
Return the categories this feed belongs to.
Examples
use atom_syndication::{Feed, Category}; let mut feed = Feed::default(); feed.set_categories(vec![Category::default()]); assert_eq!(feed.categories().len(), 1);
Set the categories this feed belongs to.
Examples
use atom_syndication::{Feed, Category}; let mut feed = Feed::default(); feed.set_categories(vec![Category::default()]);
Return the contributors to this feed.
Examples
use atom_syndication::{Feed, Person}; let mut feed = Feed::default(); feed.set_contributors(vec![Person::default()]); assert_eq!(feed.contributors().len(), 1);
Set the contributors to this feed.
Examples
use atom_syndication::{Feed, Person}; let mut feed = Feed::default(); feed.set_contributors(vec![Person::default()]);
Return the name of the software used to generate this feed.
Examples
use atom_syndication::{Feed, Generator}; let mut feed = Feed::default(); feed.set_generator(Generator::default()); assert!(feed.generator().is_some());
Set the name of the software used to generate this feed.
Examples
use atom_syndication::{Feed, Generator}; let mut feed = Feed::default(); feed.set_generator(Generator::default());
Return the icon for this feed.
Examples
use atom_syndication::Feed; let mut feed = Feed::default(); feed.set_icon("http://example.com/icon.png".to_string()); assert_eq!(feed.icon(), Some("http://example.com/icon.png"));
Set the icon for this feed.
Examples
use atom_syndication::Feed; let mut feed = Feed::default(); feed.set_icon("http://example.com/icon.png".to_string());
Return the Web pages related to this feed.
Examples
use atom_syndication::{Feed, Link}; let mut feed = Feed::default(); feed.set_links(vec![Link::default()]); assert_eq!(feed.links().len(), 1);
Set the Web pages related to this feed.
Examples
use atom_syndication::{Feed, Link}; let mut feed = Feed::default(); feed.set_links(vec![Link::default()]);
Return the logo for this feed.
Examples
use atom_syndication::Feed; let mut feed = Feed::default(); feed.set_logo("http://example.com/logo.png".to_string()); assert_eq!(feed.logo(), Some("http://example.com/logo.png"));
Set the logo for this feed.
Examples
use atom_syndication::Feed; let mut feed = Feed::default(); feed.set_logo("http://example.com/logo.png".to_string());
Return the information about the rights held in and over this feed.
Examples
use atom_syndication::{Feed, Text}; let mut feed = Feed::default(); feed.set_rights(Text::from("© 2017 John Doe")); assert_eq!(feed.rights().map(Text::as_str), Some("© 2017 John Doe"));
Set the information about the rights held in and over this feed.
Examples
use atom_syndication::{Feed, Text}; let mut feed = Feed::default(); feed.set_rights(Text::from("© 2017 John Doe"));
Return the description or subtitle of this feed.
Examples
use atom_syndication::{Feed, Text}; let mut feed = Feed::default(); feed.set_subtitle(Text::from("Feed subtitle")); assert_eq!(feed.subtitle().map(Text::as_str), Some("Feed subtitle"));
Set the description or subtitle of this feed.
Examples
use atom_syndication::{Feed, Text}; let mut feed = Feed::default(); feed.set_subtitle(Text::from("Feed subtitle"));
Return the entries in this feed.
Examples
use atom_syndication::{Feed, Entry}; let mut feed = Feed::default(); feed.set_entries(vec![Entry::default()]); assert_eq!(feed.entries().len(), 1);
Set the entries in this feed.
Examples
use atom_syndication::{Feed, Entry}; let mut feed = Feed::default(); feed.set_entries(vec![Entry::default()]);
Return the extensions for this feed.
Examples
use std::collections::BTreeMap; use atom_syndication::Feed; use atom_syndication::extension::{ExtensionMap, Extension}; let extension = Extension::default(); let mut item_map = BTreeMap::<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 feed = Feed::default(); feed.set_extensions(extension_map); assert_eq!(feed.extensions() .get("ext") .and_then(|m| m.get("ext:name")) .map(|v| v.len()), Some(1));
Set the extensions for this feed.
Examples
use atom_syndication::Feed; use atom_syndication::extension::ExtensionMap; let mut feed = Feed::default(); feed.set_extensions(ExtensionMap::default());
Return the namespaces for this feed.
Examples
use std::collections::BTreeMap; use atom_syndication::Feed; let mut namespaces = BTreeMap::new(); namespaces.insert("ext".to_string(), "http://example.com".to_string()); let mut feed = Feed::default(); feed.set_namespaces(namespaces); assert_eq!(feed.namespaces().get("ext").map(|s| s.as_str()), Some("http://example.com"));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Feedimpl UnwindSafe for FeedBlanket Implementations
Mutably borrows from an owned value. Read more