pub struct NodePath {
pub steps: Vec<PathStep>,
}Expand description
A path from a document root to a descendant.
String form accepts either style, mixed:
document/body/p[2]/r[0]/t
0/1/3
document/0/tFields§
§steps: Vec<PathStep>Path steps from the root (root itself is implied; the first step selects a child of the root, or the root when the path is empty).
Implementations§
Source§impl NodePath
impl NodePath
Sourcepub fn resolve<'a>(&self, root: &'a XmlNode) -> Result<&'a XmlNode, CoreError>
pub fn resolve<'a>(&self, root: &'a XmlNode) -> Result<&'a XmlNode, CoreError>
Resolve this path against root. The empty path returns root.
Sourcepub fn resolve_mut<'a>(
&self,
root: &'a mut XmlNode,
) -> Result<&'a mut XmlNode, CoreError>
pub fn resolve_mut<'a>( &self, root: &'a mut XmlNode, ) -> Result<&'a mut XmlNode, CoreError>
Mutable resolve.
Sourcepub fn to_op_path(&self) -> String
pub fn to_op_path(&self) -> String
Path string for a TreeOp ("" at the root, no leading slash).
Trait Implementations§
impl Eq for NodePath
impl StructuralPartialEq for NodePath
Auto Trait Implementations§
impl Freeze for NodePath
impl RefUnwindSafe for NodePath
impl Send for NodePath
impl Sync for NodePath
impl Unpin for NodePath
impl UnsafeUnpin for NodePath
impl UnwindSafe for NodePath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.