pub struct Save {
pub inner_html: bool,
pub text_content: bool,
}Expand description
Controls which pieces of content to capture for matched elements.
When an element matches a CSS selector, scah can optionally capture its inner HTML (the raw markup between the opening and closing tags) and/or its text content (the concatenated, whitespace-trimmed text nodes).
Use the convenience constructors Save::all, Save::none,
Save::only_inner_html, and Save::only_text_content to create
common configurations.
§Example
use scah::Save;
// Capture everything
let save = Save::all();
assert!(save.inner_html);
assert!(save.text_content);
// Capture only text content (lighter weight)
let save = Save::only_text_content();
assert!(!save.inner_html);
assert!(save.text_content);Fields§
§inner_html: boolWhen true, the raw HTML between the element’s opening and closing
tags is stored as Element::inner_html.
text_content: boolWhen true, the concatenated text content of the element is stored
and retrievable via Element::text_content().
Implementations§
Source§impl Save
impl Save
Sourcepub fn only_inner_html() -> Self
pub fn only_inner_html() -> Self
Capture only the raw inner HTML of matched elements.
Sourcepub fn only_text_content() -> Self
pub fn only_text_content() -> Self
Capture only the text content of matched elements.
Trait Implementations§
impl Copy for Save
impl StructuralPartialEq for Save
Auto Trait Implementations§
impl Freeze for Save
impl RefUnwindSafe for Save
impl Send for Save
impl Sync for Save
impl Unpin for Save
impl UnsafeUnpin for Save
impl UnwindSafe for Save
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