pub enum OuterHtmlStrategy {
Current,
Recursive,
}Expand description
Selector for NodeHandle::outer_html_with_strategy.
The default OuterHtmlStrategy::Current preserves the historical call
path used by NodeHandle::outer_html: a Chromium element-level
outer_html() call (which evaluates this.outerHTML via JS) followed
by a direct XMLSerializer fallback when the primary call returns an
empty payload.
OuterHtmlStrategy::Recursive uses the dedicated Chromium DevTools
Protocol command DOM.getOuterHTML (a single round-trip, browser-side
serialisation that already includes shadow-DOM roots) with a Rust-side
fallback that calls DOM.describeNode with depth = -1 and walks the
resulting CDP Node tree to produce HTML locally.
Both strategies are generic — neither relies on Wix, SPA, or vendor
attributes, classes, or heuristics. Recursive simply selects a different
CDP backend that already handles deeply nested subtrees, large SPAs, and
shadow-DOM trees correctly in a single browser-side pass.
§Example
use stygian_browser::page::OuterHtmlStrategy;
assert_eq!(OuterHtmlStrategy::default(), OuterHtmlStrategy::Current);
assert_eq!(OuterHtmlStrategy::Current.as_str(), "Current");
assert_eq!(OuterHtmlStrategy::Recursive.as_str(), "Recursive");Variants§
Current
Legacy behaviour: element-level JS eval + XMLSerializer fallback.
Recursive
CDP DOM.getOuterHTML (single round-trip) + Rust-side
DOM.describeNode walk fallback.
Implementations§
Trait Implementations§
Source§impl Clone for OuterHtmlStrategy
impl Clone for OuterHtmlStrategy
Source§fn clone(&self) -> OuterHtmlStrategy
fn clone(&self) -> OuterHtmlStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OuterHtmlStrategy
impl Debug for OuterHtmlStrategy
Source§impl Default for OuterHtmlStrategy
impl Default for OuterHtmlStrategy
Source§fn default() -> OuterHtmlStrategy
fn default() -> OuterHtmlStrategy
Source§impl<'de> Deserialize<'de> for OuterHtmlStrategy
impl<'de> Deserialize<'de> for OuterHtmlStrategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for OuterHtmlStrategy
impl Display for OuterHtmlStrategy
Source§impl Hash for OuterHtmlStrategy
impl Hash for OuterHtmlStrategy
Source§impl PartialEq for OuterHtmlStrategy
impl PartialEq for OuterHtmlStrategy
Source§impl Serialize for OuterHtmlStrategy
impl Serialize for OuterHtmlStrategy
impl Copy for OuterHtmlStrategy
impl Eq for OuterHtmlStrategy
impl StructuralPartialEq for OuterHtmlStrategy
Auto Trait Implementations§
impl Freeze for OuterHtmlStrategy
impl RefUnwindSafe for OuterHtmlStrategy
impl Send for OuterHtmlStrategy
impl Sync for OuterHtmlStrategy
impl Unpin for OuterHtmlStrategy
impl UnsafeUnpin for OuterHtmlStrategy
impl UnwindSafe for OuterHtmlStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.