Trait style::dom::TDocument

source ·
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§

source

type ConcreteNode: TNode<ConcreteDocument = Self>

The concrete TNode type.

Required Methods§

source

fn as_node(&self) -> Self::ConcreteNode

Get this document as a TNode.

source

fn is_html_document(&self) -> bool

Returns whether this document is an HTML document.

source

fn quirks_mode(&self) -> QuirksMode

Returns the quirks mode of this document.

source

fn shared_lock(&self) -> &SharedRwLock

This document’s shared lock.

Provided Methods§

source

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.

Implementors§