Skip to main content

XmlDomNode

Struct XmlDomNode 

Source
pub struct XmlDomNode<'a, 'input> { /* private fields */ }
Expand description

Copyable handle into a backend-neutral document arena.

Implementations§

Source§

impl<'a, 'input> Node<'a, 'input>

Source

pub fn id(self) -> NodeId

Returns this node’s stable arena ID.

Source

pub fn document(self) -> &'a Document<'input>

Returns the owning document.

Source

pub fn node_type(self) -> NodeType

Returns the semantic node kind.

Source

pub fn is_root(&self) -> bool

Returns whether this is the synthetic document root.

Source

pub fn is_element(&self) -> bool

Returns whether this is an element.

Source

pub fn is_text(&self) -> bool

Returns whether this is text.

Source

pub fn is_comment(&self) -> bool

Returns whether this is a comment.

Source

pub fn is_pi(&self) -> bool

Returns whether this is a processing instruction.

Source

pub fn range(self) -> Range<usize>

Returns the source byte range represented by this node.

Source

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

Returns the parent node.

Source

pub fn parent_element(self) -> Option<Self>

Returns the parent only when it is an element.

Source

pub fn children(self) -> Children<'a, 'input>

Iterates direct children in document order.

Source

pub fn first_child(self) -> Option<Self>

Returns the first direct child node.

Source

pub fn first_element_child(self) -> Option<Self>

Returns the first direct element child.

Source

pub fn last_element_child(self) -> Option<Self>

Returns the last direct element child.

Source

pub fn descendants(self) -> Descendants<'a, 'input>

Iterates this node and its descendants in document order.

Source

pub fn ancestors(self) -> Ancestors<'a, 'input>

Iterates this node and then its ancestors.

Source

pub fn prev_sibling(self) -> Option<Self>

Returns the preceding sibling.

Source

pub fn next_sibling(self) -> Option<Self>

Returns the following sibling.

Source

pub fn next_sibling_element(self) -> Option<Self>

Returns the next sibling that is an element.

Source

pub fn tag_name(self) -> ExpandedName<'a>

Returns the expanded element name, or an empty name for non-elements.

Source

pub fn has_tag_name<'n, N>(self, name: N) -> bool
where N: Into<ExpandedName<'n>>,

Tests an element against a local-name selector or an exact expanded name.

A bare string matches any namespace, mirroring roxmltree. Tuple forms match the namespace exactly, including (None, name) for an unqualified element.

Source

pub fn prefix(self) -> Option<&'a str>

Returns the element’s lexical namespace prefix.

Source

pub fn attributes(self) -> Attributes<'a>

Iterates non-namespace attributes in source order.

Source

pub fn attribute<'n, N>(self, name: N) -> Option<&'a str>
where N: Into<ExpandedName<'n>>,

Looks up an unqualified attribute by local name.

Source

pub fn namespaces(self) -> Namespaces<'a>

Iterates in-scope namespace bindings.

Source

pub fn lookup_namespace_uri(self, prefix: Option<&str>) -> Option<&'a str>

Resolves a namespace prefix in this element’s in-scope bindings.

Source

pub fn lookup_prefix(self, uri: &str) -> Option<&'a str>

Finds an in-scope prefix for a namespace URI.

Source

pub fn text(self) -> Option<&'a str>

Returns direct character data, or the first direct text child of an element.

Source

pub fn pi(self) -> Option<PI<'a>>

Returns processing-instruction data for a PI node.

Trait Implementations§

Source§

impl<'a, 'input> Clone for Node<'a, 'input>

Source§

fn clone(&self) -> Node<'a, 'input>

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<'a, 'input> Copy for Node<'a, 'input>

Source§

impl<'a, 'input> Debug for Node<'a, 'input>

Source§

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

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

impl Eq for Node<'_, '_>

Source§

impl Hash for Node<'_, '_>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
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<'a, 'input> Freeze for Node<'a, 'input>

§

impl<'a, 'input> RefUnwindSafe for Node<'a, 'input>

§

impl<'a, 'input> Send for Node<'a, 'input>

§

impl<'a, 'input> Sync for Node<'a, 'input>

§

impl<'a, 'input> Unpin for Node<'a, 'input>

§

impl<'a, 'input> UnsafeUnpin for Node<'a, 'input>

§

impl<'a, 'input> UnwindSafe for Node<'a, 'input>

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> Same for T

Source§

type Output = T

Should always be Self
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, <T as TryFrom<U>>::Error>

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.