rss_gen::validator

Struct RssFeedValidator

Source
pub struct RssFeedValidator<'a> { /* private fields */ }
Expand description

RSS feed validator for validating the structure and content of an RSS feed.

Implementations§

Source§

impl<'a> RssFeedValidator<'a>

Source

pub fn new(rss_data: &'a RssData) -> Self

Creates a new RssFeedValidator instance with the provided RssData.

§Arguments
  • rss_data - A reference to the RssData to be validated.
§Returns

A new instance of RssFeedValidator.

Source

pub fn validate(&self) -> Result<()>

Validates the RSS feed structure and content.

This method performs a comprehensive validation of the RSS feed, including structure, items, dates, and version-specific requirements.

§Returns
  • Ok(()) if the validation passes.
  • Err(RssError::ValidationErrors) containing a list of validation errors if any are found.
§Errors

This function returns an Err(RssError::ValidationErrors) if any validation checks fail.

Source

pub fn parse_date(date_str: &str) -> Result<DateTime>

Parses a date string into a DateTime object.

§Arguments
  • date_str - The date string to parse.
§Returns

A Result containing the parsed DateTime object or an error if the parsing fails.

§Errors

This function returns an Err(RssError::DateParseError) if the date format is invalid.

Trait Implementations§

Source§

impl<'a> Debug for RssFeedValidator<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for RssFeedValidator<'a>

§

impl<'a> RefUnwindSafe for RssFeedValidator<'a>

§

impl<'a> Send for RssFeedValidator<'a>

§

impl<'a> Sync for RssFeedValidator<'a>

§

impl<'a> Unpin for RssFeedValidator<'a>

§

impl<'a> UnwindSafe for RssFeedValidator<'a>

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

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T