#[non_exhaustive]pub struct ExtractInput<'a> {
pub html: &'a str,
pub url: &'a str,
pub layout_json: Option<&'a str>,
pub inner_text: Option<&'a str>,
pub selector: Option<&'a str>,
}Expand description
Input parameters for content extraction.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.html: &'a strRaw HTML of the page.
url: &'a strURL of the page (used for resolving relative links).
layout_json: Option<&'a str>JSON-serialized layout data from the injected JS, if available.
inner_text: Option<&'a str>document.body.innerText fallback, if available.
selector: Option<&'a str>CSS selector to extract a specific section instead of using Readability.
Implementations§
Source§impl<'a> ExtractInput<'a>
impl<'a> ExtractInput<'a>
Sourcepub fn new(html: &'a str, url: &'a str) -> Self
pub fn new(html: &'a str, url: &'a str) -> Self
Create a new ExtractInput with required fields.
Sourcepub fn with_layout_json(self, layout_json: Option<&'a str>) -> Self
pub fn with_layout_json(self, layout_json: Option<&'a str>) -> Self
Set the layout JSON data.
Sourcepub fn with_inner_text(self, inner_text: Option<&'a str>) -> Self
pub fn with_inner_text(self, inner_text: Option<&'a str>) -> Self
Set the inner text fallback.
Sourcepub fn with_selector(self, selector: Option<&'a str>) -> Self
pub fn with_selector(self, selector: Option<&'a str>) -> Self
Set the CSS selector for targeted extraction.
Auto Trait Implementations§
impl<'a> Freeze for ExtractInput<'a>
impl<'a> RefUnwindSafe for ExtractInput<'a>
impl<'a> Send for ExtractInput<'a>
impl<'a> Sync for ExtractInput<'a>
impl<'a> Unpin for ExtractInput<'a>
impl<'a> UnsafeUnpin for ExtractInput<'a>
impl<'a> UnwindSafe for ExtractInput<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert