[][src]Struct extrablatt::category::Category

pub struct Category {
    pub url: Url,
}

A category e.g. Politics or sports

Fields

url: Url

The address for the category website.

Implementations

impl Category[src]

pub fn new(url: Url) -> Self[src]

pub fn language_hint(&self) -> Option<Language>[src]

Tries to identify the language by checking the url against known languages.

Example

 use extrablatt::{Category, Language};
 let category = Category::new("https://cnn.com/German/".parse().unwrap());
 assert_eq!(category.language_hint(), Some(Language::German));

pub async fn into_stream(
    self
) -> Result<impl Stream<Item = Result<Article, ExtrablattError>>>
[src]

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

pub async fn into_stream_with_extractor<TExtractor: Extractor + Unpin>(
    self,
    extractor: TExtractor
) -> Result<impl Stream<Item = Result<Article, ExtrablattError>>>
[src]

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

Trait Implementations

impl Borrow<str> for Category[src]

impl Clone for Category[src]

impl Debug for Category[src]

impl Eq for Category[src]

impl Hash for Category[src]

impl PartialEq<Category> for Category[src]

impl StructuralEq for Category[src]

impl StructuralPartialEq for Category[src]

Auto Trait Implementations

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.