#[non_exhaustive]pub struct RssItem {
pub guid: String,
pub category: Option<String>,
pub description: String,
pub link: String,
pub pub_date: String,
pub title: String,
pub author: String,
pub comments: Option<String>,
pub enclosure: Option<String>,
pub source: Option<String>,
}
Expand description
Represents an item in the RSS feed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.guid: String
The GUID of the RSS item (unique identifier).
category: Option<String>
The category of the RSS item.
description: String
The description of the RSS item.
link: String
The link to the RSS item.
pub_date: String
The publication date of the RSS item.
title: String
The title of the RSS item.
The author of the RSS item.
comments: Option<String>
The comments URL related to the RSS item (optional).
enclosure: Option<String>
The enclosure (typically for media like podcasts) (optional).
source: Option<String>
The source of the RSS item (optional).
Implementations§
source§impl RssItem
impl RssItem
sourcepub fn set<T: Into<String>>(self, field: RssItemField, value: T) -> Self
pub fn set<T: Into<String>>(self, field: RssItemField, value: T) -> Self
sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validates the RssItem
to ensure all required fields are set and valid.
§Returns
Ok(())
if theRssItem
is valid.Err(RssError)
if any validation errors are found.
sourcepub fn description<T: Into<String>>(self, value: T) -> Self
pub fn description<T: Into<String>>(self, value: T) -> Self
Sets the description.
Sets the author.
sourcepub fn pub_date_parsed(&self) -> Result<DateTime>
pub fn pub_date_parsed(&self) -> Result<DateTime>
Parses the pub_date
string into a DateTime
object.
§Returns
Ok(DateTime)
if the date is valid and successfully parsed.Err(RssError)
if the date is invalid or cannot be parsed.
Trait Implementations§
source§impl<'de> Deserialize<'de> for RssItem
impl<'de> Deserialize<'de> for RssItem
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RssItem
impl StructuralPartialEq for RssItem
Auto Trait Implementations§
impl Freeze for RssItem
impl RefUnwindSafe for RssItem
impl Send for RssItem
impl Sync for RssItem
impl Unpin for RssItem
impl UnwindSafe for RssItem
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)