Skip to main content

ExtractInput

Struct ExtractInput 

Source
#[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 str

Raw HTML of the page.

§url: &'a str

URL 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>

Source

pub fn new(html: &'a str, url: &'a str) -> Self

Create a new ExtractInput with required fields.

Source

pub fn with_layout_json(self, layout_json: Option<&'a str>) -> Self

Set the layout JSON data.

Source

pub fn with_inner_text(self, inner_text: Option<&'a str>) -> Self

Set the inner text fallback.

Source

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V