pub trait TDocument:
Sized
+ Copy
+ Clone {
type ConcreteNode: TNode<ConcreteDocument = Self>;
// Required methods
fn as_node(&self) -> Self::ConcreteNode;
fn is_html_document(&self) -> bool;
fn quirks_mode(&self) -> QuirksMode;
fn shared_lock(&self) -> &SharedRwLock;
// Provided method
fn elements_with_id<'a>(
&self,
_id: &AtomIdent,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>
where Self: 'a { ... }
}
Expand description
The TDocument
trait, to represent a document node.
Required Associated Types§
sourcetype ConcreteNode: TNode<ConcreteDocument = Self>
type ConcreteNode: TNode<ConcreteDocument = Self>
The concrete TNode
type.
Required Methods§
sourcefn as_node(&self) -> Self::ConcreteNode
fn as_node(&self) -> Self::ConcreteNode
Get this document as a TNode
.
sourcefn is_html_document(&self) -> bool
fn is_html_document(&self) -> bool
Returns whether this document is an HTML document.
sourcefn quirks_mode(&self) -> QuirksMode
fn quirks_mode(&self) -> QuirksMode
Returns the quirks mode of this document.
This document’s shared lock.
Provided Methods§
sourcefn elements_with_id<'a>(
&self,
_id: &AtomIdent,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>where
Self: 'a,
fn elements_with_id<'a>(
&self,
_id: &AtomIdent,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>where
Self: 'a,
Get a list of elements with a given ID in this document, sorted by tree position.
Can return an error to signal that this list is not available, or also return an empty slice.
Object Safety§
This trait is not object safe.