#[non_exhaustive]pub struct AtomFeed {Show 14 fields
pub id: String,
pub title: String,
pub subtitle: String,
pub updated: String,
pub rights: String,
pub generator: String,
pub icon: String,
pub logo: String,
pub language: String,
pub authors: Vec<AtomPerson>,
pub contributors: Vec<AtomPerson>,
pub links: Vec<AtomLink>,
pub categories: Vec<String>,
pub entries: Vec<AtomEntry>,
}Expand description
An Atom 1.0 feed (<feed>) document.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringPermanent, universally unique identifier of the feed (RFC 4287 §4.2.6).
title: StringHuman-readable title of the feed.
subtitle: StringOptional human-readable subtitle.
updated: StringRFC 3339 timestamp of the most recent significant modification.
rights: StringOptional rights / copyright string.
generator: StringGenerator identification (e.g. "rss-gen").
icon: StringOptional URI of a small icon representing the feed.
logo: StringOptional URI of a larger logo representing the feed.
language: StringLanguage tag (e.g. "en-US"). Emitted as xml:lang on <feed>.
Authors of the feed.
contributors: Vec<AtomPerson>Contributors to the feed.
links: Vec<AtomLink>Links advertised at feed level (self, alternate, …).
categories: Vec<String>Category tags applied to the feed (term values only).
entries: Vec<AtomEntry>Entries contained in the feed.
Implementations§
Source§impl AtomFeed
impl AtomFeed
Sourcepub fn updated<S: Into<String>>(self, value: S) -> Self
pub fn updated<S: Into<String>>(self, value: S) -> Self
Sets the feed-level updated timestamp (RFC 3339).
Adds an author with the given name.
Adds an AtomPerson to the author list.
Sourcepub fn add_contributor(self, contributor: AtomPerson) -> Self
pub fn add_contributor(self, contributor: AtomPerson) -> Self
Adds an AtomPerson to the contributor list.
Sourcepub fn self_link<S: Into<String>>(self, href: S) -> Self
pub fn self_link<S: Into<String>>(self, href: S) -> Self
Convenience: adds a rel="self" link to the canonical feed URL.
Sourcepub fn alternate_link<S: Into<String>>(self, href: S) -> Self
pub fn alternate_link<S: Into<String>>(self, href: S) -> Self
Convenience: adds a rel="alternate" link to the human page.
Sourcepub fn add_category<S: Into<String>>(self, term: S) -> Self
pub fn add_category<S: Into<String>>(self, term: S) -> Self
Adds a category tag.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Number of entries in the feed.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validates the feed against the required RFC 4287 elements.
Error messages are prefixed with feed. for top-level violations
and entry.<idx>. for per-entry violations, matching the contextual
validation introduced in issue #34 for the RSS code path.
§Errors
Returns RssError::ValidationErrors containing every missing or
invalid required element discovered.