pub struct Dom { /* private fields */ }Implementations§
Source§impl Dom
impl Dom
pub fn new() -> Self
pub fn from_base(inner: BaseDocument) -> Self
pub fn document(&self) -> NodeId
pub fn inner(&self) -> &BaseDocument
pub fn inner_mut(&mut self) -> &mut BaseDocument
Sourcepub fn node_ref(&self, id: NodeId) -> NodeRef<'_>
pub fn node_ref(&self, id: NodeId) -> NodeRef<'_>
Returns a lightweight borrowed reference to a node without allocating.
Sourcepub fn children_of(&self, id: NodeId) -> ChildrenIter<'_> ⓘ
pub fn children_of(&self, id: NodeId) -> ChildrenIter<'_> ⓘ
Returns an iterator over the children of a node, reading directly
from the BaseDocument children vec without allocating.
pub fn get(&self, id: NodeId) -> Option<Node>
pub fn get_mut(&mut self, id: NodeId) -> Option<&mut BaseDocument>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn create_element( &mut self, name: QualName, attrs: Vec<Attribute>, ) -> NodeId
pub fn create_text(&mut self, text: String) -> NodeId
pub fn create_comment(&mut self, _text: String) -> NodeId
pub fn create_document_fragment(&mut self) -> NodeId
pub fn create_shadow_root( &mut self, _host: NodeId, _mode: ShadowRootMode, ) -> NodeId
pub fn allocate_pi(&mut self, _target: String, _data: String) -> NodeId
pub fn create_doctype( &mut self, _name: String, _public_id: String, _system_id: String, ) -> NodeId
pub fn append_child(&mut self, parent: NodeId, child: NodeId)
pub fn insert_before( &mut self, parent: NodeId, child: NodeId, reference: NodeId, )
pub fn detach(&mut self, id: NodeId)
pub fn remove(&mut self, id: NodeId)
pub fn reparent_children(&mut self, source: NodeId, target: NodeId)
pub fn children(&self, parent: NodeId) -> Vec<NodeId>
pub fn child_elements(&self, parent: NodeId) -> Vec<NodeId>
pub fn text_content(&self, id: NodeId) -> String
pub fn set_text_content(&mut self, id: NodeId, text: &str)
pub fn get_element_by_id(&self, id_value: &str) -> Option<NodeId>
pub fn get_elements_by_tag_name(&self, root: NodeId, tag: &str) -> Vec<NodeId>
pub fn get_elements_by_class_name( &self, root: NodeId, class: &str, ) -> Vec<NodeId>
pub fn serialize_html(&self, id: NodeId) -> String
pub fn serialize_inner_html(&self, id: NodeId) -> String
pub fn merge_subtree(&mut self, source: &Dom, source_root: NodeId) -> NodeId
pub fn node_type(&self, id: NodeId) -> u32
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Dom
impl !RefUnwindSafe for Dom
impl !Send for Dom
impl !Sync for Dom
impl !UnwindSafe for Dom
impl Unpin for Dom
impl UnsafeUnpin for Dom
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert