feed_rs::parser

Struct Builder

source
pub struct Builder { /* private fields */ }
Expand description

Builder to create instances of FeedParser

Implementations§

source§

impl Builder

source

pub fn new() -> Builder

Create a new instance of the builder

source

pub fn base_uri<S: AsRef<str>>(self, uri: Option<S>) -> Self

Source of the content, used to resolve relative URLs in XML based feeds

source

pub fn build(self) -> Parser

Create a new instance of the parser

source

pub fn id_generator<F>(self, generator: F) -> Self
where F: Fn(&[Link], &Option<Text>, Option<&str>) -> String + 'static,

Registers an ID generator

source

pub fn id_generator_v0_2(self) -> Self

Registers an ID generator compatible with v0.2 of feed-rs

source

pub fn timestamp_parser<F>(self, ts_parser: F) -> Self
where F: Fn(&str) -> Option<DateTime<Utc>> + 'static,

Registers a custom timestamp parser

Trait Implementations§

source§

impl Default for Builder

Creates a parser instance with sensible defaults

source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Builder

§

impl !RefUnwindSafe for Builder

§

impl !Send for Builder

§

impl !Sync for Builder

§

impl Unpin for Builder

§

impl !UnwindSafe for Builder

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.