Struct CaptureNames

pub struct CaptureNames<'r>(/* private field */);

An iterator over the names of all capture groups in a regex.

This iterator yields values of type Option<&str> in order of the opening capture group parenthesis in the regex pattern. None is yielded for groups with no name. The first element always corresponds to the implicit and unnamed group for the overall match.

'r is the lifetime of the compiled regular expression.

This iterator is created by Regex::capture_names.

Trait Implementations

impl<'r> Clone for CaptureNames<'r>

fn clone(&self) -> CaptureNames<'r>

impl<'r> Debug for CaptureNames<'r>

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

impl<'r> ExactSizeIterator for CaptureNames<'r>

impl<'r> FusedIterator for CaptureNames<'r>

impl<'r> Iterator for CaptureNames<'r>

type Item = Option<&'r str>;
fn next(&mut self) -> Option<Option<&'r str>>
fn size_hint(&self) -> (usize, Option<usize>)
fn count(self) -> usize

Auto Trait Implementations

impl<'r> Freeze for CaptureNames<'r>

impl<'r> RefUnwindSafe for CaptureNames<'r>

impl<'r> Send for CaptureNames<'r>

impl<'r> Sync for CaptureNames<'r>

impl<'r> Unpin for CaptureNames<'r>

impl<'r> UnsafeUnpin for CaptureNames<'r>

impl<'r> UnwindSafe for CaptureNames<'r>

Blanket Implementations

impl<I> IntoIterator for CaptureNames<'r> where I: Iterator,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

impl<T> Any for CaptureNames<'r> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for CaptureNames<'r> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for CaptureNames<'r> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for CaptureNames<'r> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for CaptureNames<'r>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for CaptureNames<'r> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for CaptureNames<'r> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for CaptureNames<'r> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for CaptureNames<'r> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>