Skip to main content

DomStore

Struct DomStore 

Source
pub struct DomStore { /* private fields */ }

Implementations§

Source§

impl DomStore

Source

pub fn new_empty() -> DomStore

Source

pub fn source_html(&self) -> Option<&str>

Source

pub fn document_id(&self) -> NodeId

Source

pub fn node_count(&self) -> usize

Source

pub fn nodes(&self) -> &[NodeRecord]

Source

pub fn indexes(&self) -> &DomIndexes

Source

pub fn side_tables(&self) -> &DomSideTables

Source

pub fn focused_node(&self) -> Option<NodeId>

Source

pub fn set_focused_node(&mut self, focused_node: Option<NodeId>)

Source

pub fn target_fragment(&self) -> Option<&str>

Source

pub fn set_target_fragment(&mut self, target_fragment: Option<String>)

Source

pub fn document_state(&self) -> &DocumentState

Source§

impl DomStore

Source

pub fn bootstrap_html(&mut self, html: impl Into<String>) -> Result<(), String>

Source

pub fn select(&self, selector: &str) -> Result<Vec<NodeId>, String>

Source

pub fn select_with_scope( &self, selector: &str, scope_root: Option<NodeId>, ) -> Result<Vec<NodeId>, String>

Source

pub fn dump_dom(&self) -> String

Source

pub fn document_title(&self) -> String

Source

pub fn set_document_title( &mut self, value: impl Into<String>, ) -> Result<(), String>

Source

pub fn get_attribute( &self, node_id: NodeId, name: &str, ) -> Result<Option<String>, String>

Source

pub fn has_attribute(&self, node_id: NodeId, name: &str) -> Result<bool, String>

Source

pub fn set_attribute( &mut self, node_id: NodeId, name: &str, value: impl Into<String>, ) -> Result<(), String>

Source

pub fn remove_attribute( &mut self, node_id: NodeId, name: &str, ) -> Result<bool, String>

Source

pub fn toggle_attribute( &mut self, node_id: NodeId, name: &str, force: Option<bool>, ) -> Result<bool, String>

Source

pub fn set_text_content( &mut self, node_id: NodeId, value: &str, ) -> Result<(), String>

Source

pub fn create_element( &mut self, tag_name: impl Into<String>, ) -> Result<NodeId, String>

Source

pub fn create_element_ns( &mut self, namespace_uri: impl Into<String>, tag_name: impl Into<String>, ) -> Result<NodeId, String>

Source

pub fn create_text_node( &mut self, value: impl Into<String>, ) -> Result<NodeId, String>

Source

pub fn create_comment( &mut self, value: impl Into<String>, ) -> Result<NodeId, String>

Source

pub fn clone_node( &mut self, node_id: NodeId, deep: bool, ) -> Result<NodeId, String>

Source

pub fn text_content_for_node(&self, node_id: NodeId) -> String

Source

pub fn value_for_node(&self, node_id: NodeId) -> String

Source

pub fn checked_for_node(&self, node_id: NodeId) -> Option<bool>

Source

pub fn indeterminate_for_node(&self, node_id: NodeId) -> Option<bool>

Source

pub fn is_content_editable(&self, node_id: NodeId) -> bool

Source

pub fn set_form_control_value( &mut self, node_id: NodeId, value: impl Into<String>, ) -> Result<(), String>

Source

pub fn set_select_value( &mut self, node_id: NodeId, value: impl Into<String>, ) -> Result<(), String>

Source

pub fn set_form_control_checked( &mut self, node_id: NodeId, checked: bool, ) -> Result<(), String>

Source

pub fn set_form_control_indeterminate( &mut self, node_id: NodeId, indeterminate: bool, ) -> Result<(), String>

Source

pub fn set_file_input_files( &mut self, node_id: NodeId, files: impl IntoIterator<Item = impl Into<String>>, ) -> Result<(), String>

Source

pub fn inner_html_for_node(&self, node_id: NodeId) -> Result<String, String>

Source

pub fn outer_html_for_node(&self, node_id: NodeId) -> Result<String, String>

Source

pub fn set_inner_html( &mut self, node_id: NodeId, html: &str, ) -> Result<(), String>

Source

pub fn set_outer_html( &mut self, node_id: NodeId, html: &str, ) -> Result<(), String>

Source

pub fn append_html_to_document(&mut self, html: &str) -> Result<(), String>

Source

pub fn document_open(&mut self) -> Result<(), String>

Source

pub fn insert_adjacent_html( &mut self, node_id: NodeId, position: &str, html: &str, ) -> Result<(), String>

Source

pub fn append_child( &mut self, parent: NodeId, child: NodeId, ) -> Result<(), String>

Source

pub fn append_children<I>( &mut self, parent: NodeId, children: I, ) -> Result<(), String>
where I: IntoIterator<Item = NodeId>,

Source

pub fn prepend_children<I>( &mut self, parent: NodeId, children: I, ) -> Result<(), String>
where I: IntoIterator<Item = NodeId>,

Source

pub fn insert_before( &mut self, parent: NodeId, child: NodeId, reference: NodeId, ) -> Result<(), String>

Source

pub fn insert_children_before<I>( &mut self, parent: NodeId, reference: NodeId, children: I, ) -> Result<(), String>
where I: IntoIterator<Item = NodeId>,

Source

pub fn insert_children_after<I>( &mut self, parent: NodeId, reference: NodeId, children: I, ) -> Result<(), String>
where I: IntoIterator<Item = NodeId>,

Source

pub fn replace_child( &mut self, parent: NodeId, new_child: NodeId, old_child: NodeId, ) -> Result<(), String>

Source

pub fn replace_children<I>( &mut self, parent: NodeId, children: I, ) -> Result<(), String>
where I: IntoIterator<Item = NodeId>,

Source

pub fn remove_node(&mut self, node_id: NodeId) -> Result<(), String>

Source

pub fn normalize_node(&mut self, node_id: NodeId) -> Result<(), String>

Source

pub fn root_element_id(&self) -> Option<NodeId>

Source

pub fn document_element_id(&self) -> Option<NodeId>

Source

pub fn head_element_id(&self) -> Option<NodeId>

Source

pub fn body_element_id(&self) -> Option<NodeId>

Trait Implementations§

Source§

impl Clone for DomStore

Source§

fn clone(&self) -> DomStore

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DomStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for DomStore

Source§

fn default() -> DomStore

Returns the “default value” for a type. Read more
Source§

impl PartialEq for DomStore

Source§

fn eq(&self, other: &DomStore) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for DomStore

Source§

impl StructuralPartialEq for DomStore

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.