[][src]Struct feed_rs::model::Feed

pub struct Feed {
    pub id: String,
    pub title: Option<Text>,
    pub updated: DateTime<Utc>,
    pub authors: Vec<Person>,
    pub description: Option<Text>,
    pub links: Vec<Link>,
    pub categories: Vec<Category>,
    pub contributors: Vec<Person>,
    pub generator: Option<Generator>,
    pub icon: Option<Image>,
    pub language: Option<String>,
    pub logo: Option<Image>,
    pub published: Option<DateTime<Utc>>,
    pub rights: Option<Text>,
    pub ttl: Option<u32>,
    pub entries: Vec<Entry>,
}

Combined model for a syndication feed (i.e. RSS1, RSS 2, Atom, JSON Feed)

The model is based on the Atom standard as a start with RSS1+2 mapped on to it e.g.

  • Atom
    • Feed -> Feed
    • Entry -> Entry
  • RSS 1 + 2
    • Channel -> Feed
    • Item -> Entry

Certain elements are not mapped given their limited utility:

  • RSS 2:
    • channel - docs (pointer to the spec), cloud (for callbacks), textInput (text box e.g. for search)
    • item - comments (link to comments on the article), source (pointer to the channel, but our data model links items to a channel)
  • RSS 1:
    • channel - rdf:about attribute (pointer to feed), textinput (text box e.g. for search)

Fields

id: String

A unique identifier for this feed

  • Atom (required): Identifies the feed using a universally unique and permanent URI.
  • RSS doesn't require an ID so it is initialised to a UUID
title: Option<Text>

The title of the feed

  • Atom (required): Contains a human readable title for the feed. Often the same as the title of the associated website. This value should not be blank.
  • RSS 1 + 2 (required) "title": The name of the channel. It's how people refer to your service.
  • JSON Feed: is the name of the feed
updated: DateTime<Utc>

The time at which the feed was last modified. If not provided in the source, it is set to the current time.

  • Atom (required): Indicates the last time the feed was modified in a significant way.
  • RSS 2 (optional) "lastBuildDate": The last time the content of the channel changed.
authors: Vec<Person>

Atom (recommended): Collection of authors defined at the feed level. JSON Feed: specifies the feed author.

description: Option<Text>

Description of the feed

  • Atom (optional): Contains a human-readable description or subtitle for the feed (from ).
  • RSS 1 + 2 (required): Phrase or sentence describing the channel.
  • JSON Feed: description of the feed
links: Vec<Link>

Links to related pages

  • Atom (recommended): Identifies a related Web page.
  • RSS 1 + 2 (required): The URL to the HTML website corresponding to the channel.
  • JSON Feed: the homepage and feed URLs
categories: Vec<Category>

Structured classification of the feed

  • Atom (optional): Specifies a category that the feed belongs to. A feed may have multiple category elements.
  • RSS 2 (optional) "category": Specify one or more categories that the channel belongs to.
contributors: Vec<Person>

People who have contributed to the feed

  • Atom (optional): Names one contributor to the feed. A feed may have multiple contributor elements.
  • RSS 2 (optional) "managingEditor": Email address for person responsible for editorial content.
  • RSS 2 (optional) "webMaster": Email address for person responsible for technical issues relating to channel.
generator: Option<Generator>

Information on the software used to build the feed

  • Atom (optional): Identifies the software used to generate the feed, for debugging and other purposes.
  • RSS 2 (optional): A string indicating the program used to generate the channel.
icon: Option<Image>

A small icon

  • Atom (optional): Identifies a small image which provides iconic visual identification for the feed.
  • JSON Feed: is the URL of an image for the feed suitable to be used in a source list.
language: Option<String>

RSS 2 (optional): The language the channel is written in.

An image used to visually identify the feed

  • Atom (optional): Identifies a larger image which provides visual identification for the feed.
  • RSS 1 + 2 (optional) "image": Specifies a GIF, JPEG or PNG image that can be displayed with the channel.
  • JSON Feed: is the URL of an image for the feed suitable to be used in a timeline
published: Option<DateTime<Utc>>

RSS 2 (optional): The publication date for the content in the channel.

rights: Option<Text>

Rights restricting content within the feed

  • Atom (optional): Conveys information about rights, e.g. copyrights, held in and over the feed.
  • RSS 2 (optional) "copyright": Copyright notice for content in the channel.
ttl: Option<u32>

RSS 2 (optional): It's a number of minutes that indicates how long a channel can be cached before refreshing from the source.

entries: Vec<Entry>

The individual items within the feed

  • Atom (optional): Individual entries within the feed (e.g. a blog post)
  • RSS 1+2 (optional): Individual items within the channel.

Trait Implementations

impl Debug for Feed[src]

impl Default for Feed[src]

impl PartialEq<Feed> for Feed[src]

impl StructuralPartialEq for Feed[src]

Auto Trait Implementations

impl RefUnwindSafe for Feed

impl Send for Feed

impl Sync for Feed

impl Unpin for Feed

impl UnwindSafe for Feed

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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,