pub struct EmailCapture<'a, S: HaystackSlice<'a>>(/* private fields */);Available on crate feature
demo only.Expand description
A macro-generated type that holds 5 captures for the associated regex, Email. If present, named groups can be retrieved through their associated method.
Capture types include methods to retrieve individual captures as a slice of the original haystack, or as the underlying Range<usize>, which can be used to manually slice the haystack (without risk of panicking in the case of &str).
As is common with regular expressions, group 0 refers to the whole match (and is therefore aliased as EmailCapture::whole_match).
Implementations§
Source§impl<'a, S: HaystackSlice<'a>> EmailCapture<'a, S>
impl<'a, S: HaystackSlice<'a>> EmailCapture<'a, S>
pub fn cap_0(&self) -> S
pub fn cap_0_range(&self) -> Range<usize>
pub fn cap_1(&self) -> S
pub fn cap_1_range(&self) -> Range<usize>
pub fn cap_2(&self) -> S
pub fn cap_2_range(&self) -> Range<usize>
pub fn cap_3(&self) -> S
pub fn cap_3_range(&self) -> Range<usize>
pub fn cap_4(&self) -> Option<S>
pub fn cap_4_range(&self) -> Option<Range<usize>>
pub fn whole_match(&self) -> S
pub fn whole_match_range(&self) -> Range<usize>
pub fn domain(&self) -> S
pub fn domain_range(&self) -> Range<usize>
Trait Implementations§
Source§impl<'a, S: HaystackSlice<'a>> CaptureFromRanges<'a, S, 5> for EmailCapture<'a, S>
impl<'a, S: HaystackSlice<'a>> CaptureFromRanges<'a, S, 5> for EmailCapture<'a, S>
Source§impl<'a, S: Clone + HaystackSlice<'a>> Clone for EmailCapture<'a, S>
impl<'a, S: Clone + HaystackSlice<'a>> Clone for EmailCapture<'a, S>
Source§fn clone(&self) -> EmailCapture<'a, S>
fn clone(&self) -> EmailCapture<'a, S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a, S> Freeze for EmailCapture<'a, S>where
S: Freeze,
impl<'a, S> RefUnwindSafe for EmailCapture<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for EmailCapture<'a, S>where
S: Send,
impl<'a, S> Sync for EmailCapture<'a, S>where
S: Sync,
impl<'a, S> Unpin for EmailCapture<'a, S>where
S: Unpin,
impl<'a, S> UnsafeUnpin for EmailCapture<'a, S>where
S: UnsafeUnpin,
impl<'a, S> UnwindSafe for EmailCapture<'a, S>where
S: UnwindSafe,
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