[−][src]Struct extrablatt::article::Article
A full representation of a news article.
Example
Download a single article directly
let article = Article::builder("http://example.com/")?.get().await?;
Fields
url: Url
The url of the article.
doc: Document
The parsed response html Document
.
content: ArticleContent<'static>
The extracted content of the article.
language: Language
The expected language of the article.
Implementations
impl Article
[src]
pub fn new<U: IntoUrl, T: AsRef<str>>(url: U, doc: T) -> Result<Article>
[src]
Extract the article directly from the doc using the DefaultExtractor
pub fn with_extractor<U, T, TExtract>(
url: U,
doc: T,
extractor: &TExtract
) -> Result<Article> where
U: IntoUrl,
T: AsRef<str>,
TExtract: Extractor,
[src]
url: U,
doc: T,
extractor: &TExtract
) -> Result<Article> where
U: IntoUrl,
T: AsRef<str>,
TExtract: Extractor,
pub fn with_extractor_and_lang<U, T, TExtract>(
url: U,
doc: T,
extractor: &TExtract,
language: Language
) -> Result<Article> where
U: IntoUrl,
T: AsRef<str>,
TExtract: Extractor,
[src]
url: U,
doc: T,
extractor: &TExtract,
language: Language
) -> Result<Article> where
U: IntoUrl,
T: AsRef<str>,
TExtract: Extractor,
Extract the article directly from the doc using the provided extractor
and lang
pub async fn content<T: IntoUrl>(url: T) -> Result<ArticleContent<'static>>
[src]
Retrieves the ArticleContent
from the url
Convenience method for:
let content = Article::builder("http://example.com")?.get().await?.content;
pub async fn get<T: IntoUrl>(url: T) -> Result<Article>
[src]
Get the Article
for the url
pub async fn get_with_extractor<T: IntoUrl, TExtract: Extractor, '_>(
url: T,
extractor: &'_ TExtract
) -> Result<Article>
[src]
url: T,
extractor: &'_ TExtract
) -> Result<Article>
Get the Article
for the url
using a specific Extractor
pub fn builder<T: IntoUrl>(url: T) -> Result<ArticleBuilder>
[src]
Convenience method for creating a new ArticleBuilder
Same as calling ArticleBuilder::new
pub fn drop_document(self) -> PureArticle
[src]
Drops the article's html select::document::Document
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Article
impl !Send for Article
impl !Sync for Article
impl Unpin for Article
impl UnwindSafe for Article
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,