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