QueryMatchCaptures

Struct QueryMatchCaptures 

Source
pub struct QueryMatchCaptures<'query, 'tree, Query: Query + 'tree> { /* private fields */ }
Expand description

Captures from a QueryMatch

Implementations§

Source§

impl<'query, 'tree, Query: Query + 'tree> QueryMatchCaptures<'query, 'tree, Query>

Source

pub fn iter(&self) -> impl Iterator<Item = Query::Capture<'query, 'tree>> + '_

Iterate the captures

Source

pub fn get(&self, index: usize) -> Option<Query::Capture<'query, 'tree>>

Get the capture at the index

Source

pub fn index(&self, index: usize) -> Query::Capture<'query, 'tree>

Get the capture at the index. Panics if the index is out of bounds

Source

pub fn is_empty(&self) -> bool

Are there any captures?

Source

pub fn len(&self) -> usize

Get the number of captures

Trait Implementations§

Source§

impl<'query, 'tree, Query: Query + 'tree> IntoIterator for QueryMatchCaptures<'query, 'tree, Query>

Source§

type Item = <Query as Query>::Capture<'query, 'tree>

The type of the elements being iterated over.
Source§

type IntoIter = QueryMatchCapturesIntoIter<'query, 'tree, Query>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'query, 'tree, Query> Freeze for QueryMatchCaptures<'query, 'tree, Query>

§

impl<'query, 'tree, Query> RefUnwindSafe for QueryMatchCaptures<'query, 'tree, Query>
where Query: RefUnwindSafe,

§

impl<'query, 'tree, Query> Send for QueryMatchCaptures<'query, 'tree, Query>
where Query: Sync,

§

impl<'query, 'tree, Query> Sync for QueryMatchCaptures<'query, 'tree, Query>
where Query: Sync,

§

impl<'query, 'tree, Query> Unpin for QueryMatchCaptures<'query, 'tree, Query>

§

impl<'query, 'tree, Query> UnwindSafe for QueryMatchCaptures<'query, 'tree, Query>
where Query: RefUnwindSafe,

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> 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<I> IntoStreamingIterator for I
where I: IntoIterator,

Source§

fn into_streaming_iter(self) -> Convert<Self::IntoIter>

Source§

fn into_streaming_iter_ref<'a, T>(self) -> ConvertRef<'a, Self::IntoIter, T>
where Self: IntoIterator<Item = &'a T>, T: ?Sized,

Turns an IntoIterator of references into a StreamingIterator. Read more
Source§

fn into_streaming_iter_mut<'a, T>(self) -> ConvertMut<'a, Self::IntoIter, T>
where Self: IntoIterator<Item = &'a mut T>, T: ?Sized,

Turns an IntoIterator of mutable references into a StreamingIteratorMut. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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.