pub struct Snapshot {
pub url: String,
pub title: String,
pub focus: Option<String>,
pub document: DomNode,
}Expand description
The page at one moment, as the browser holds it.
Fields§
§url: String§title: String§focus: Option<String>/html[1]/body[1]/main[1]/input[2] — the focused element’s path, None when focus is on
the document itself.
document: DomNodeImplementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn body_markup(&self) -> String
pub fn body_markup(&self) -> String
The body in the reference renderer’s serialization, so it compares byte for byte with
semantics::dom::render().
Whitespace-only text directly under <body> is the document’s own formatting — the line
breaks around the markup a shell or a pre-render writes — and never page content, so it is
left out. Every other text node is kept exactly.
Sourcepub fn head_markup(&self) -> Option<String>
pub fn head_markup(&self) -> Option<String>
The head’s elements in the reference renderer’s serialization, in document order — the
whitespace text between them is the document’s own formatting and is left out, as
Snapshot::body_markup leaves it out under <body>. None when the head holds no element.
Sourcepub fn head_markup_without_stylesheets(
&self,
hrefs: &[String],
) -> Option<String>
pub fn head_markup_without_stylesheets( &self, hrefs: &[String], ) -> Option<String>
Snapshot::head_markup without the <link rel="stylesheet"> elements for hrefs — the
stylesheets a serving shell links for its project, which no page runtime on any tier
produces, so they are not the page’s head.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Snapshot
impl<'de> Deserialize<'de> for Snapshot
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>,
impl Eq for Snapshot
impl StructuralPartialEq for Snapshot
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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
§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.