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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OuterHtmlStrategy
Source§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
impl Eq for OuterHtmlStrategy
Source§impl Hash for OuterHtmlStrategy
impl Hash for OuterHtmlStrategy
Source§impl PartialEq for OuterHtmlStrategy
impl PartialEq for OuterHtmlStrategy
Source§fn eq(&self, other: &OuterHtmlStrategy) -> bool
fn eq(&self, other: &OuterHtmlStrategy) -> bool
self and other values to be equal, and is used by ==.