[][src]Enum htmldom_read::NodeAccess

pub enum NodeAccess {
    Owned(Node),
    Sharable(Arc<Node>),
}

How node is being stored and accessed.

Variants

Owned(Node)Sharable(Arc<Node>)

Methods

impl NodeAccess[src]

pub fn try_mut(&mut self) -> Option<&mut Node>[src]

Try to access node mutably. If this node is owned then this is possible. For sharable nodes they can be accessed mutable only if they still were not shared.

pub fn to_sharable(&self) -> Arc<Node>[src]

Convert this node to a sharable by cloning.

pub fn to_owned(&self) -> Node[src]

Convert this node to an owned by cloning.

pub fn wrap_to_root(self) -> Result<Self, Self>[src]

Wrap this leaf node into root node. See wrap_to_root from Node for details.

Methods from Deref<Target = Node>

pub fn start(&self) -> &Option<OpeningTag>[src]

Start tag information.

pub fn end(&self) -> Option<&str>[src]

End tag information.

pub fn text(&self) -> Option<&str>[src]

Text that appears between opening and closing tags.

pub fn children(&self) -> &Children[src]

Children tags of this node.

pub fn tag_name(&self) -> Option<&str>[src]

The name of the tag that is represented by the node.

pub fn attributes(&self) -> Option<&Vec<Attribute>>[src]

Start tag attributes.

pub fn attribute_by_name(&self, key: &str) -> Option<&Attribute>[src]

Find attribute by it's name.

pub fn children_fetch(&self) -> ChildrenFetch[src]

Get children fetcher for this node to find children that apply to some criteria.

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

Convert this node and all it's children into HTML string.

pub fn clone_without_children(&self) -> Self[src]

Clone this node without cloning children leaving new node with empty children list.

pub fn is_root(&self) -> bool[src]

Check whether this node is the root of the tree.

Trait Implementations

impl PartialEq<NodeAccess> for NodeAccess[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl From<Node> for NodeAccess[src]

impl From<Arc<Node>> for NodeAccess[src]

impl Clone for NodeAccess[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Deref for NodeAccess[src]

type Target = Node

The resulting type after dereferencing.

impl Debug for NodeAccess[src]

Auto Trait Implementations

impl Send for NodeAccess

impl Sync for NodeAccess

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.