Skip to main content

Node

Struct Node 

Source
pub struct Node { /* private fields */ }
Expand description

A node: a document and the position of the node in it.

Two Node values are equal when they are the same node (XPath is).

Implementations§

Source§

impl Node

Source

pub fn document(&self) -> &Rc<Document>

The document the node belongs to.

Source

pub fn kind(&self) -> NodeKind

The node kind.

Source

pub fn name(&self) -> Option<&QName>

The name of an element or attribute, with the prefix it was written with, or the target of a processing instruction (as a local name); None for other nodes.

Source

pub fn parent(&self) -> Option<Self>

The parent node.

Source

pub fn root(&self) -> Self

The root of the tree: always the document node.

Source

pub fn string_value(&self) -> Cow<'_, str>

The string value (XDM dm:string-value).

Source

pub fn typed_value(&self) -> AtomicValue

The typed value of the node in an untyped tree: xs:untypedAtomic, except for comments and processing instructions, whose typed value is an xs:string.

Source

pub fn axis(&self, axis: NodeAxis) -> Axis ⓘ

The nodes on an axis from this node, in axis order (reverse document order for the reverse axes).

Source

pub fn children(&self) -> Axis ⓘ

The children, in document order.

Source

pub fn attributes(&self) -> Axis ⓘ

The attributes, in document order (the order of the source).

Source

pub fn cmp_document_order(&self, other: &Self) -> Ordering

Document order. Nodes of different documents are ordered by the creation of their documents.

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Node

Source§

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

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

impl Eq for Node

Source§

impl From<Node> for Item

Source§

fn from(node: Node) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Node

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl !Send for Node

§

impl !Sync for Node

§

impl Forget for Node

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.