Skip to main content

Email

Struct Email 

Source
pub struct Email;
Available on crate feature demo only.
Expand description

A macro-generated regular expression matching the pattern: (\w+)@(?<domain>(\w+)(\.\w+)?) with flags: []. See the Regex trait for associated matching and capturing functions.

Trait Implementations§

Source§

impl Clone for Email

Source§

fn clone(&self) -> Email

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Email

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Regex<char, 5> for Email

Source§

type Pattern = Then<char, CaptureGroup<char, QuantifierNOrMore<char, Or4<char, ScalarRange<'0', '9'>, ScalarRange<'A', 'Z'>, Scalar<'_'>, ScalarRange<'a', 'z'>>, 1>, 1>, Then<char, LiteralMatcher<EmailLiteral0>, CaptureGroup<char, Then<char, CaptureGroup<char, QuantifierNOrMore<char, Or4<char, ScalarRange<'0', '9'>, ScalarRange<'A', 'Z'>, Scalar<'_'>, ScalarRange<'a', 'z'>>, 1>, 3>, QuantifierNToM<char, CaptureGroup<char, Then<char, LiteralMatcher<EmailLiteral1>, QuantifierNOrMore<char, Or4<char, ScalarRange<'0', '9'>, ScalarRange<'A', 'Z'>, Scalar<'_'>, ScalarRange<'a', 'z'>>, 1>>, 4>, 0, 1>>, 2>>>

This type is a macro generated combination of ZSTs responsible for doing all of the heavy lifting involved in actually matching or capturing against a Haystack. For realistic expressions, this type will be very long an unpleasant to type, hence implementing it as an associated type.
Source§

type Anchors = MinLen<3>

This type is another macro generated combination of ZSTs representing the assertions that the expression can make before attempting to match against a Haystack. This should be much more minimal than Self::Pattern in most cases.
Source§

type Capture<'a, S: HaystackSlice<'a>> = EmailCapture<'a, S>

A macro generated type holding all N capture groups in this expression, producing ranges or slices of the haystack with aliases for named groups. The generated type also understands which groups will always exist in a match and which are optional. Read more
Source§

fn is_match<'a, H>(hay: impl IntoHaystack<'a, H>) -> bool
where H: HaystackOf<'a, I>,

Returns true if this Regex matches the entire haystack provided. This should probably be the default matching function to use. Read more
Source§

fn contains_match<'a, H>(hay: impl IntoHaystack<'a, H>) -> bool
where H: HaystackOf<'a, I>,

Returns true if this Regex matches any substring of the haystack provided. To retrieve the actual substring itself, use slice_match or find_capture. Read more
Source§

fn count_matches<'a, H>( hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> usize
where H: HaystackOf<'a, I>,

Returns the number of matches present in the haystack provided, optionally including overlapping matches. Read more
Source§

fn range_of_match<'a, H>(hay: impl IntoHaystack<'a, H>) -> Option<Range<usize>>
where H: HaystackOf<'a, I>,

Returns the range that matches this Regex first. This is the range variant of contains_match. For the actual substring itself, see slice_match. Read more
Source§

fn range_of_all_matches<'a, H>( hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> RangeOfAllMatches<'a, Self, I, H, N>
where H: HaystackOf<'a, I>,

Returns an iterator over the ranges of all substrings in the provided haystack that match this Regex, optionally overlapping. For the actual substrings themselves, see slice_all_matches. Read more
Source§

fn slice_match<'a, H>( hay: impl IntoHaystack<'a, H>, ) -> Option<<H as Haystack<'a>>::Slice>
where H: HaystackOf<'a, I>,

Returns the slice that matches this Regex first. This is the slicing variant of range_of_match. Read more
Source§

fn slice_all_matches<'a, H>( hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> SliceAllMatches<'a, Self, I, H, N>
where H: HaystackOf<'a, I>,

Returns an iterator over all slices of the provided haystack that match this Regex, optionally overlapping. Read more
Source§

fn do_capture<'a, H>( hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, <H as Haystack<'a>>::Slice>>
where H: HaystackOf<'a, I>,

Returns a Self::Capture representing the provided haystack matched against this Regex. This includes any named or numbered capturing groups in the expression. As with is_match, this function acts on the entire haystack, and needs to match every character from start to end. Read more
Source§

fn find_capture<'a, H>( hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, <H as Haystack<'a>>::Slice>>
where H: HaystackOf<'a, I>,

Returns the Self::Capture that matches this Regex first, similar to slice_match but with any named or numbered groups included. Read more
Source§

fn find_all_captures<'a, H>( hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> FindAllCaptures<'a, Self, I, H, N>
where H: HaystackOf<'a, I>,

Returns an iterator over Self::Captures representing every full match of this Regex in the provided haystack, similar to slice_all_matches. This can optionally include overlapping matches. Read more
Source§

fn replace<'a, M>( hay_mut: &mut M, with: <<M as OwnedHaystackable<I>>::Hay<'a> as Haystack<'a>>::Slice, ) -> bool
where M: OwnedHaystackable<I>,

Replaces the first match of this Regex in the provided haystack with the provided slice. The slice type required is the one associated with the provided haystack. The return value is a boolean indicating whether a match was found and replaced.
Source§

fn replace_all<'a, M>( hay_mut: &mut M, with: <<M as OwnedHaystackable<I>>::Hay<'a> as Haystack<'a>>::Slice, ) -> usize
where M: OwnedHaystackable<I>,

Replaces every matching substring in the provided haystack with a copy of the provided slice. The slice type required is the one associated with the provided haystack. The return value is an integer representing the number of matches and replacements that occurred.
Source§

fn replace_all_using<M>(hay_mut: &mut M, using: impl FnMut() -> M) -> usize
where M: OwnedHaystackable<I>,

Replaces every matching substring in the provided haystack with the return value of the provided function. The return type of this function needs to match the provided haystack. The returned integer represents the number of matches and replacements that occurred. Read more
Source§

fn replace_using_iter<M>( hay_mut: &mut M, iter: impl IntoIterator<Item = M>, ) -> usize
where M: OwnedHaystackable<I>,

Replaces matching substrings in the provided haystack with the values produced by the iterator, until no matches remain or the iterator returns None. The return type of this iterator needs to match the provided haystack. The returned integer represents the number of matches and replacements that occurred. Read more
Source§

fn replace_captured<M, F>(hay_mut: &mut M, replacer: F) -> bool
where M: OwnedHaystackable<I>, F: for<'a> FnOnce(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as Haystack<'a>>::Slice>) -> M,

Replaces the first captured substring in the provided haystack with a computed value. The return value is a boolean indicating whether a match was found and replaced. Read more
Source§

fn replace_all_captured<M, F>(hay_mut: &mut M, replacer: F) -> usize
where M: OwnedHaystackable<I>, F: for<'a> FnMut(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as Haystack<'a>>::Slice>) -> M,

Replaces all captured substring in the provided haystack with a computed value. The return value is an integer indicating the number of matches found and replaced. Read more
Source§

impl Regex<u8, 5> for Email

Source§

type Pattern = Then<u8, CaptureGroup<u8, QuantifierNOrMore<u8, Or4<u8, ByteRange<48, 57>, ByteRange<65, 90>, Byte<95>, ByteRange<97, 122>>, 1>, 1>, Then<u8, LiteralMatcher<EmailLiteral0>, CaptureGroup<u8, Then<u8, CaptureGroup<u8, QuantifierNOrMore<u8, Or4<u8, ByteRange<48, 57>, ByteRange<65, 90>, Byte<95>, ByteRange<97, 122>>, 1>, 3>, QuantifierNToM<u8, CaptureGroup<u8, Then<u8, LiteralMatcher<EmailLiteral1>, QuantifierNOrMore<u8, Or4<u8, ByteRange<48, 57>, ByteRange<65, 90>, Byte<95>, ByteRange<97, 122>>, 1>>, 4>, 0, 1>>, 2>>>

This type is a macro generated combination of ZSTs responsible for doing all of the heavy lifting involved in actually matching or capturing against a Haystack. For realistic expressions, this type will be very long an unpleasant to type, hence implementing it as an associated type.
Source§

type Anchors = MinLen<3>

This type is another macro generated combination of ZSTs representing the assertions that the expression can make before attempting to match against a Haystack. This should be much more minimal than Self::Pattern in most cases.
Source§

type Capture<'a, S: HaystackSlice<'a>> = EmailCapture<'a, S>

A macro generated type holding all N capture groups in this expression, producing ranges or slices of the haystack with aliases for named groups. The generated type also understands which groups will always exist in a match and which are optional. Read more
Source§

fn is_match<'a, H>(hay: impl IntoHaystack<'a, H>) -> bool
where H: HaystackOf<'a, I>,

Returns true if this Regex matches the entire haystack provided. This should probably be the default matching function to use. Read more
Source§

fn contains_match<'a, H>(hay: impl IntoHaystack<'a, H>) -> bool
where H: HaystackOf<'a, I>,

Returns true if this Regex matches any substring of the haystack provided. To retrieve the actual substring itself, use slice_match or find_capture. Read more
Source§

fn count_matches<'a, H>( hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> usize
where H: HaystackOf<'a, I>,

Returns the number of matches present in the haystack provided, optionally including overlapping matches. Read more
Source§

fn range_of_match<'a, H>(hay: impl IntoHaystack<'a, H>) -> Option<Range<usize>>
where H: HaystackOf<'a, I>,

Returns the range that matches this Regex first. This is the range variant of contains_match. For the actual substring itself, see slice_match. Read more
Source§

fn range_of_all_matches<'a, H>( hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> RangeOfAllMatches<'a, Self, I, H, N>
where H: HaystackOf<'a, I>,

Returns an iterator over the ranges of all substrings in the provided haystack that match this Regex, optionally overlapping. For the actual substrings themselves, see slice_all_matches. Read more
Source§

fn slice_match<'a, H>( hay: impl IntoHaystack<'a, H>, ) -> Option<<H as Haystack<'a>>::Slice>
where H: HaystackOf<'a, I>,

Returns the slice that matches this Regex first. This is the slicing variant of range_of_match. Read more
Source§

fn slice_all_matches<'a, H>( hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> SliceAllMatches<'a, Self, I, H, N>
where H: HaystackOf<'a, I>,

Returns an iterator over all slices of the provided haystack that match this Regex, optionally overlapping. Read more
Source§

fn do_capture<'a, H>( hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, <H as Haystack<'a>>::Slice>>
where H: HaystackOf<'a, I>,

Returns a Self::Capture representing the provided haystack matched against this Regex. This includes any named or numbered capturing groups in the expression. As with is_match, this function acts on the entire haystack, and needs to match every character from start to end. Read more
Source§

fn find_capture<'a, H>( hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, <H as Haystack<'a>>::Slice>>
where H: HaystackOf<'a, I>,

Returns the Self::Capture that matches this Regex first, similar to slice_match but with any named or numbered groups included. Read more
Source§

fn find_all_captures<'a, H>( hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> FindAllCaptures<'a, Self, I, H, N>
where H: HaystackOf<'a, I>,

Returns an iterator over Self::Captures representing every full match of this Regex in the provided haystack, similar to slice_all_matches. This can optionally include overlapping matches. Read more
Source§

fn replace<'a, M>( hay_mut: &mut M, with: <<M as OwnedHaystackable<I>>::Hay<'a> as Haystack<'a>>::Slice, ) -> bool
where M: OwnedHaystackable<I>,

Replaces the first match of this Regex in the provided haystack with the provided slice. The slice type required is the one associated with the provided haystack. The return value is a boolean indicating whether a match was found and replaced.
Source§

fn replace_all<'a, M>( hay_mut: &mut M, with: <<M as OwnedHaystackable<I>>::Hay<'a> as Haystack<'a>>::Slice, ) -> usize
where M: OwnedHaystackable<I>,

Replaces every matching substring in the provided haystack with a copy of the provided slice. The slice type required is the one associated with the provided haystack. The return value is an integer representing the number of matches and replacements that occurred.
Source§

fn replace_all_using<M>(hay_mut: &mut M, using: impl FnMut() -> M) -> usize
where M: OwnedHaystackable<I>,

Replaces every matching substring in the provided haystack with the return value of the provided function. The return type of this function needs to match the provided haystack. The returned integer represents the number of matches and replacements that occurred. Read more
Source§

fn replace_using_iter<M>( hay_mut: &mut M, iter: impl IntoIterator<Item = M>, ) -> usize
where M: OwnedHaystackable<I>,

Replaces matching substrings in the provided haystack with the values produced by the iterator, until no matches remain or the iterator returns None. The return type of this iterator needs to match the provided haystack. The returned integer represents the number of matches and replacements that occurred. Read more
Source§

fn replace_captured<M, F>(hay_mut: &mut M, replacer: F) -> bool
where M: OwnedHaystackable<I>, F: for<'a> FnOnce(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as Haystack<'a>>::Slice>) -> M,

Replaces the first captured substring in the provided haystack with a computed value. The return value is a boolean indicating whether a match was found and replaced. Read more
Source§

fn replace_all_captured<M, F>(hay_mut: &mut M, replacer: F) -> usize
where M: OwnedHaystackable<I>, F: for<'a> FnMut(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as Haystack<'a>>::Slice>) -> M,

Replaces all captured substring in the provided haystack with a computed value. The return value is an integer indicating the number of matches found and replaced. Read more
Source§

impl Copy for Email

Auto Trait Implementations§

§

impl Freeze for Email

§

impl RefUnwindSafe for Email

§

impl Send for Email

§

impl Sync for Email

§

impl Unpin for Email

§

impl UnsafeUnpin for Email

§

impl UnwindSafe for Email

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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.