Entry

Struct Entry 

Source
pub struct Entry {
Show 34 fields pub id: Option<SmallString>, pub title: Option<String>, pub title_detail: Option<TextConstruct>, pub link: Option<String>, pub links: Vec<Link>, pub summary: Option<String>, pub summary_detail: Option<TextConstruct>, pub content: Vec<Content>, pub published: Option<DateTime<Utc>>, pub updated: Option<DateTime<Utc>>, pub created: Option<DateTime<Utc>>, pub expired: Option<DateTime<Utc>>, pub author: Option<SmallString>, pub author_detail: Option<Person>, pub authors: Vec<Person>, pub contributors: Vec<Person>, pub publisher: Option<SmallString>, pub publisher_detail: Option<Person>, pub tags: Vec<Tag>, pub enclosures: Vec<Enclosure>, pub comments: Option<String>, pub source: Option<Source>, pub itunes: Option<Box<ItunesEntryMeta>>, pub dc_creator: Option<SmallString>, pub dc_date: Option<DateTime<Utc>>, pub dc_subject: Vec<String>, pub dc_rights: Option<String>, pub media_thumbnails: Vec<MediaThumbnail>, pub media_content: Vec<MediaContent>, pub podcast_transcripts: Vec<PodcastTranscript>, pub podcast_persons: Vec<PodcastPerson>, pub podcast: Option<Box<PodcastEntryMeta>>, pub geo: Option<Box<GeoLocation>>, pub license: Option<String>,
}
Expand description

Feed entry/item

Fields§

§id: Option<SmallString>

Unique entry identifier (stored inline for IDs ≤24 bytes)

§title: Option<String>

Entry title

§title_detail: Option<TextConstruct>

Detailed title with metadata

§link: Option<String>

Primary link

§links: Vec<Link>

All links associated with this entry

§summary: Option<String>

Short description/summary

§summary_detail: Option<TextConstruct>

Detailed summary with metadata

§content: Vec<Content>

Full content blocks

§published: Option<DateTime<Utc>>

Publication date

§updated: Option<DateTime<Utc>>

Last update date

§created: Option<DateTime<Utc>>

Creation date

§expired: Option<DateTime<Utc>>

Expiration date

§author: Option<SmallString>

Primary author name (stored inline for names ≤24 bytes)

§author_detail: Option<Person>

Detailed author information

§authors: Vec<Person>

All authors

§contributors: Vec<Person>

Contributors

§publisher: Option<SmallString>

Publisher name (stored inline for names ≤24 bytes)

§publisher_detail: Option<Person>

Detailed publisher information

§tags: Vec<Tag>

Tags/categories

§enclosures: Vec<Enclosure>

Media enclosures (audio, video, etc.)

§comments: Option<String>

Comments URL or text

§source: Option<Source>

Source feed reference

§itunes: Option<Box<ItunesEntryMeta>>

iTunes episode metadata (if present)

§dc_creator: Option<SmallString>

Dublin Core creator (author fallback) - stored inline for names ≤24 bytes

§dc_date: Option<DateTime<Utc>>

Dublin Core date (publication date fallback)

§dc_subject: Vec<String>

Dublin Core subjects (tags)

§dc_rights: Option<String>

Dublin Core rights (copyright)

§media_thumbnails: Vec<MediaThumbnail>

Media RSS thumbnails

§media_content: Vec<MediaContent>

Media RSS content items

§podcast_transcripts: Vec<PodcastTranscript>

Podcast 2.0 transcripts for this episode

§podcast_persons: Vec<PodcastPerson>

Podcast 2.0 persons for this episode (hosts, guests, etc.)

§podcast: Option<Box<PodcastEntryMeta>>

Podcast 2.0 episode metadata

§geo: Option<Box<GeoLocation>>

GeoRSS location data

§license: Option<String>

License URL (Creative Commons, etc.)

Implementations§

Source§

impl Entry

Source

pub fn with_capacity() -> Self

Creates Entry with pre-allocated capacity for collections

Pre-allocates space for typical entry fields:

  • 1-2 links (alternate, related)
  • 1 content block
  • 1 author
  • 2-3 tags
  • 0-1 enclosures
  • 2 podcast transcripts (typical for podcasts with multiple languages)
  • 4 podcast persons (host, co-hosts, guests)
§Examples
use feedparser_rs::Entry;

let entry = Entry::with_capacity();
Source

pub fn set_title(&mut self, text: TextConstruct)

Sets title field with TextConstruct, storing both simple and detailed versions

§Examples
use feedparser_rs::{Entry, TextConstruct};

let mut entry = Entry::default();
entry.set_title(TextConstruct::text("Great Article"));
assert_eq!(entry.title.as_deref(), Some("Great Article"));
Source

pub fn set_summary(&mut self, text: TextConstruct)

Sets summary field with TextConstruct, storing both simple and detailed versions

§Examples
use feedparser_rs::{Entry, TextConstruct};

let mut entry = Entry::default();
entry.set_summary(TextConstruct::text("A summary"));
assert_eq!(entry.summary.as_deref(), Some("A summary"));
Source

pub fn set_author(&mut self, person: Person)

Sets author field with Person, storing both simple and detailed versions

§Examples
use feedparser_rs::{Entry, Person};

let mut entry = Entry::default();
entry.set_author(Person::from_name("Jane Doe"));
assert_eq!(entry.author.as_deref(), Some("Jane Doe"));
Source

pub fn set_publisher(&mut self, person: Person)

Sets publisher field with Person, storing both simple and detailed versions

§Examples
use feedparser_rs::{Entry, Person};

let mut entry = Entry::default();
entry.set_publisher(Person::from_name("ACME Corp"));
assert_eq!(entry.publisher.as_deref(), Some("ACME Corp"));

Sets the primary link and adds it to the links collection

This is a convenience method that:

  1. Sets the link field (if not already set)
  2. Adds an “alternate” link to the links collection
§Examples
use feedparser_rs::Entry;

let mut entry = Entry::default();
entry.set_alternate_link("https://example.com/post/1".to_string(), 10);
assert_eq!(entry.link.as_deref(), Some("https://example.com/post/1"));
assert_eq!(entry.links.len(), 1);
assert_eq!(entry.links[0].rel.as_deref(), Some("alternate"));

Trait Implementations§

Source§

impl Clone for Entry

Source§

fn clone(&self) -> Entry

Returns a duplicate 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() -> Entry

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

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, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more