pub struct NodeList<'a, T: VariantValue>(/* private fields */);Expand description
A list of nodes resulting from an SPath query.
Each node within the list is a borrowed reference to the node in the original
VariantValue that was queried.
Implementations§
Source§impl<'a, T: VariantValue> NodeList<'a, T>
impl<'a, T: VariantValue> NodeList<'a, T>
Sourcepub fn at_most_one(&self) -> Result<Option<&'a T>, AtMostOneError>
pub fn at_most_one(&self) -> Result<Option<&'a T>, AtMostOneError>
Extract at most one node from a NodeList
This is intended for queries that are expected to optionally yield a single node.
Sourcepub fn exactly_one(&self) -> Result<&'a T, ExactlyOneError>
pub fn exactly_one(&self) -> Result<&'a T, ExactlyOneError>
Extract exactly one node from a NodeList
This is intended for queries that are expected to yield exactly one node.
Sourcepub fn all(self) -> Vec<&'a T>
pub fn all(self) -> Vec<&'a T>
Extract all nodes yielded by the query
This is intended for queries that are expected to yield zero or more nodes.
Sourcepub fn iter(&self) -> Iter<'_, &T>
pub fn iter(&self) -> Iter<'_, &T>
Get an iterator over a NodeList
Note that NodeList also implements IntoIterator.
Sourcepub fn first(&self) -> Option<&'a T>
pub fn first(&self) -> Option<&'a T>
Returns the first node in the NodeList, or None if it is empty
Trait Implementations§
Source§impl<'a, T: VariantValue> IntoIterator for NodeList<'a, T>
impl<'a, T: VariantValue> IntoIterator for NodeList<'a, T>
impl<'a, T: Eq + VariantValue> Eq for NodeList<'a, T>
impl<'a, T: VariantValue> StructuralPartialEq for NodeList<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for NodeList<'a, T>
impl<'a, T> RefUnwindSafe for NodeList<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for NodeList<'a, T>where
T: Sync,
impl<'a, T> Sync for NodeList<'a, T>where
T: Sync,
impl<'a, T> Unpin for NodeList<'a, T>
impl<'a, T> UnwindSafe for NodeList<'a, T>where
T: RefUnwindSafe,
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.