Trait moxie_dom::prelude::RawDom[][src]

pub trait RawDom {
    type Nodes: IntoIterator;
    type MutationRecord;
    type Observer: Stream + Unpin;
    pub fn write_xml<W>(&self, writer: &mut Writer<W>)
    where
        W: Write
;
pub fn get_attribute(&self, name: &str) -> Option<String>;
pub fn set_attribute(&self, name: &str, value: &str);
pub fn remove_attribute(&self, name: &str);
pub fn next_sibling(&self) -> Option<Self>;
pub fn first_child(&self) -> Option<Self>;
pub fn append_child(&self, child: &Self);
pub fn replace_child(&self, new_child: &Self, existing: &Self);
pub fn remove_child(&self, to_remove: &Self) -> Option<Self>;
pub fn get_inner_text(&self) -> String;
pub fn dispatch<E>(&self, event: E)
    where
        E: Event
;
pub fn query_selector(&self, selectors: &str) -> Option<Self>;
pub fn query_selector_all(&self, selectors: &str) -> Self::Nodes;
pub fn observe_mutations(&self) -> Self::Observer; pub fn outer_html(&self) -> String { ... }
pub fn pretty_outer_html(&self, indent: usize) -> String { ... } }

A value which implements a subset of the web’s document object model.

Associated Types

type Nodes: IntoIterator[src]

The type returned by query_selector_all.

type MutationRecord[src]

The type returned in batches by Dom::Observer.

type Observer: Stream + Unpin[src]

The type returned by observe.

Loading content...

Required methods

pub fn write_xml<W>(&self, writer: &mut Writer<W>) where
    W: Write
[src]

Write this value as XML via the provided writer. Consider using Dom::outer_html or Dom::pretty_outer_html unless you need the performance.

pub fn get_attribute(&self, name: &str) -> Option<String>[src]

Get an attribute from this DOM node.

pub fn set_attribute(&self, name: &str, value: &str)[src]

Set an attribute on this DOM node.

pub fn remove_attribute(&self, name: &str)[src]

Ensure the provided attribute has been removed from this DOM node.

pub fn next_sibling(&self) -> Option<Self>[src]

Returns the next child of this node’s parent after this node itself.

pub fn first_child(&self) -> Option<Self>[src]

Returns the first child of this node.

pub fn append_child(&self, child: &Self)[src]

Adds a new child to the end of this node’s children.

pub fn replace_child(&self, new_child: &Self, existing: &Self)[src]

Replaces the provided child of this node with a new one.

pub fn remove_child(&self, to_remove: &Self) -> Option<Self>[src]

Removes the provided child from this node.

pub fn get_inner_text(&self) -> String[src]

Represents the “rendered” text content of a node and its descendants. It approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.

pub fn dispatch<E>(&self, event: E) where
    E: Event
[src]

Synchronously invokes the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().

pub fn query_selector(&self, selectors: &str) -> Option<Self>[src]

Returns the first descendant of self which matches the specified selectors.

pub fn query_selector_all(&self, selectors: &str) -> Self::Nodes[src]

Returns a static (not live) Vec of descendents of self which match the specified selectors.

pub fn observe_mutations(&self) -> Self::Observer[src]

Return a stream of mutations related to the subtree under this node.

Loading content...

Provided methods

pub fn outer_html(&self) -> String[src]

Returns a string of serialized XML without newlines or indentation.

pub fn pretty_outer_html(&self, indent: usize) -> String[src]

Returns a string of “prettified” serialized XML with the provided indentation.

Loading content...

Implementations on Foreign Types

impl Dom for Node[src]

type MutationRecord = MutationRecord

type Nodes = NodeList

type Observer = Mutations

impl Dom for Rc<VirtNode>[src]

type MutationRecord = Mutation

type Nodes = Vec<Rc<VirtNode>, Global>

type Observer = UnboundedReceiver<Vec<Mutation, Global>>

Loading content...

Implementors

impl Dom for moxie_dom::prelude::RawNode[src]

type MutationRecord = MutationRecord

type Nodes = Vec<Node, Global>

type Observer = MutationObserver

Loading content...