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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.