feed_rs::model

Struct Entry

source
pub struct Entry {
Show 15 fields pub id: String, pub title: Option<Text>, pub updated: Option<DateTime<Utc>>, pub authors: Vec<Person>, pub content: Option<Content>, pub links: Vec<Link>, pub summary: Option<Text>, pub categories: Vec<Category>, pub contributors: Vec<Person>, pub published: Option<DateTime<Utc>>, pub source: Option<String>, pub rights: Option<Text>, pub media: Vec<MediaObject>, pub language: Option<String>, pub base: Option<String>,
}
Expand description

An item within a feed

Fields§

§id: String

A unique identifier for this item with a feed. If not supplied it is initialised to a hash of the first link or a UUID if not available.

  • Atom (required): Identifies the entry using a universally unique and permanent URI.
  • RSS 2 (optional) “guid”: A string that uniquely identifies the item.
  • RSS 1: does not specify a unique ID as a separate item, but does suggest the URI should be “the same as the link” so we use a hash of the link if found
  • JSON Feed: is unique for that item for that feed over time.
§title: Option<Text>

Title of this item within the feed

  • Atom, RSS 1(required): Contains a human readable title for the entry.
  • RSS 2 (optional): The title of the item.
  • JSON Feed: The title of the item.
§updated: Option<DateTime<Utc>>

Time at which this item was last modified. If not provided in the source, or invalid, it is None.

  • Atom (required): Indicates the last time the entry was modified in a significant way.
  • RSS doesn’t specify this field, so we copy it from the entry ‘published’ field for consistency.
  • JSON Feed: the last modification date of this item
§authors: Vec<Person>

Authors of this item

  • Atom (recommended): Collection of authors defined at the entry level.
  • RSS 2 (optional): Email address of the author of the item.
  • JSON Feed: the author of the item
§content: Option<Content>

The content of the item

  • Atom (recommended): Contains or links to the complete content of the entry.
  • RSS 2 (optional) “content:encoded”: The HTML form of the content
  • JSON Feed: the html content of the item, or the text content if no html is specified
§links: Vec<Link>

Links associated with this item

  • Atom (recommended): Identifies a related Web page.
  • RSS 2 (optional): The URL of the item.
  • RSS 1 (required): The item’s URL.
  • JSON Feed: the url and external URL for the item is the first items, then each subsequent attachment
§summary: Option<Text>

A short summary of the item

  • Atom (recommended): Conveys a short summary, abstract, or excerpt of the entry.
  • RSS 1 (optional): Populated from the RSS namespace ‘description’ field, or if not present, the Dublin Core namespace ‘description’ field.
  • RSS 2 (optional): Populated from the RSS namespace ‘description’ field.
  • JSON Feed: the summary for the item, or the text content if no summary is provided and both text and html content are specified

Warning: Some feeds (especially RSS) use significant whitespace in this field even in cases where it should be considered HTML. Consider rendering this field in a way that preserves whitespace-based formatting such as a double-newline to separate paragraphs.

§categories: Vec<Category>

Structured classification of the item

  • Atom (optional): Specifies a category that the entry belongs to. A feed may have multiple category elements.
  • RSS 2 (optional): Includes the item in one or more categories.
  • JSON Feed: the supplied item tags
§contributors: Vec<Person>

Atom (optional): Names one contributor to the entry. A feed may have multiple contributor elements.

§published: Option<DateTime<Utc>>

Time at which this item was first published

  • Atom (optional): Contains the time of the initial creation or first availability of the entry.
  • RSS 2 (optional) “pubDate”: Indicates when the item was published.
  • JSON Feed: the date at which the item was published
§source: Option<String>

Atom (optional): If an entry is copied from one feed into another feed, then this contains the source feed metadata.

§rights: Option<Text>

Atom (optional): Conveys information about rights, e.g. copyrights, held in and over the feed.

§media: Vec<MediaObject>

Extension for MediaRSS - https://www.rssboard.org/media-rss A MediaObject will be created in two cases:

  1. each “media:group” element encountered in the feed
  2. a default for any other “media:*” elements found at the item level

See the Atom tests for youtube and newscred for examples

§language: Option<String>

Atom (optional): The language specified on the item

§base: Option<String>

Atom (optional): The base url specified on the item to resolve any relative references found within the scope on the item

Trait Implementations§

source§

impl Clone for Entry

source§

fn clone(&self) -> Entry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Entry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Entry

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq for Entry

source§

fn eq(&self, other: &Entry) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Entry

Auto Trait Implementations§

§

impl Freeze for Entry

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnwindSafe for Entry

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.