[][src]Struct extrablatt::extrablatt::ArticleStream

#[must_use = "streams do nothing unless polled"]pub struct ArticleStream<TExtractor: Extractor> { /* fields omitted */ }

Stream for getting a Article each at a time.

Implementations

impl ArticleStream<DefaultExtractor>[src]

pub async fn new<T: IntoUrl>(url: T) -> Result<ArticleStream<DefaultExtractor>>[src]

Fetch all article urls from the page the url points to and return a new stream of articles using the crate::DefaultExtractor.

Example

Create a new crate::ArticleStream that yields all articles referenced on https:://example.com/some/path

let mut stream = ArticleStream::new("https:://example.com/some/path").await?;
    while let Some(article) = stream.next().await {
        // ...
    }

impl<TExtractor: Extractor + Unpin> ArticleStream<TExtractor>[src]

pub async fn new_with_extractor<T: IntoUrl>(
    url: T,
    extractor: TExtractor
) -> Result<ArticleStream<TExtractor>>
[src]

Fetch all article urls from the page the url points to and return a new stream of articles using a designated crate::Extractor.

Trait Implementations

impl<TExtractor: Extractor + Unpin> Stream for ArticleStream<TExtractor>[src]

type Item = Result<Article, ExtrablattError>

Values yielded by the stream.

Auto Trait Implementations

impl<TExtractor> !RefUnwindSafe for ArticleStream<TExtractor>

impl<TExtractor> !Send for ArticleStream<TExtractor>

impl<TExtractor> !Sync for ArticleStream<TExtractor>

impl<TExtractor> Unpin for ArticleStream<TExtractor> where
    TExtractor: Unpin

impl<TExtractor> !UnwindSafe for ArticleStream<TExtractor>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<St> StreamExt for St where
    St: Stream + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

impl<S> TryStreamExt for S where
    S: TryStream
[src]