pub enum NodeAccess {
Owned(Node),
Sharable(Arc<Node>),
}
Expand description
How node is being stored and accessed.
Variants§
Implementations§
Source§impl NodeAccess
impl NodeAccess
Sourcepub fn try_mut(&mut self) -> Option<&mut Node>
pub fn try_mut(&mut self) -> Option<&mut Node>
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.
Sourcepub fn to_sharable(&self) -> Arc<Node>
pub fn to_sharable(&self) -> Arc<Node>
Convert this node to a sharable by cloning.
Sourcepub fn wrap_to_root(self) -> Result<Self, Self>
pub fn wrap_to_root(self) -> Result<Self, Self>
Wrap this leaf node into root node. See wrap_to_root
from Node
for details.
Methods from Deref<Target = Node>§
Sourcepub fn start(&self) -> &Option<OpeningTag>
pub fn start(&self) -> &Option<OpeningTag>
Start tag information.
Sourcepub fn attributes(&self) -> Option<&Vec<Attribute>>
pub fn attributes(&self) -> Option<&Vec<Attribute>>
Start tag attributes.
Sourcepub fn attribute_by_name(&self, key: &str) -> Option<&Attribute>
pub fn attribute_by_name(&self, key: &str) -> Option<&Attribute>
Find attribute by it’s name.
Sourcepub fn children_fetch(&self) -> ChildrenFetch<'_>
pub fn children_fetch(&self) -> ChildrenFetch<'_>
Get children fetcher for this node to find children that apply to some criteria.
Sourcepub fn clone_without_children(&self) -> Self
pub fn clone_without_children(&self) -> Self
Clone this node without cloning children leaving new node with empty children list.
Trait Implementations§
Source§impl Clone for NodeAccess
impl Clone for NodeAccess
Source§fn clone(&self) -> NodeAccess
fn clone(&self) -> NodeAccess
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NodeAccess
impl Debug for NodeAccess
Source§impl Deref for NodeAccess
impl Deref for NodeAccess
Source§impl From<Node> for NodeAccess
impl From<Node> for NodeAccess
Source§impl PartialEq for NodeAccess
impl PartialEq for NodeAccess
Auto Trait Implementations§
impl Freeze for NodeAccess
impl RefUnwindSafe for NodeAccess
impl Send for NodeAccess
impl Sync for NodeAccess
impl Unpin for NodeAccess
impl UnwindSafe for NodeAccess
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