pub enum RefCaptureVariant<'a> {
Unnamed,
ManyUnnamed,
NumberedUnnamed {
sections: usize,
},
Named(&'a str),
ManyNamed(&'a str),
NumberedNamed {
sections: usize,
name: &'a str,
},
}
Expand description
Token representing various types of captures.
It can capture and discard for unnamed variants, or capture and store in the Matches
for the
named variants.
Its name stems from the fact that it does not have ownership over all its values. It gets converted to CaptureVariant, a nearly identical enum that has owned Strings instead.
Variants§
Unnamed
{}
ManyUnnamed
{*}
NumberedUnnamed
{5}
Named(&'a str)
{name} - captures a section and adds it to the map with a given name.
ManyNamed(&'a str)
{*:name} - captures over many sections and adds it to the map with a given name.
NumberedNamed
{2:name} - captures a fixed number of sections with a given name.
Trait Implementations§
Source§impl<'a> Clone for RefCaptureVariant<'a>
impl<'a> Clone for RefCaptureVariant<'a>
Source§fn clone(&self) -> RefCaptureVariant<'a>
fn clone(&self) -> RefCaptureVariant<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for RefCaptureVariant<'a>
impl<'a> Debug for RefCaptureVariant<'a>
Source§impl<'a> From<RefCaptureVariant<'a>> for CaptureVariant
impl<'a> From<RefCaptureVariant<'a>> for CaptureVariant
Source§fn from(v: RefCaptureVariant<'a>) -> Self
fn from(v: RefCaptureVariant<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for RefCaptureVariant<'a>
impl<'a> PartialEq for RefCaptureVariant<'a>
impl<'a> Copy for RefCaptureVariant<'a>
impl<'a> StructuralPartialEq for RefCaptureVariant<'a>
Auto Trait Implementations§
impl<'a> Freeze for RefCaptureVariant<'a>
impl<'a> RefUnwindSafe for RefCaptureVariant<'a>
impl<'a> Send for RefCaptureVariant<'a>
impl<'a> Sync for RefCaptureVariant<'a>
impl<'a> Unpin for RefCaptureVariant<'a>
impl<'a> UnwindSafe for RefCaptureVariant<'a>
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