pub trait AnonRegex<I, const N: usize>: Regex<I, N>where
I: HaystackItem,{
Show 15 methods
// Provided methods
fn is_match<'a, H>(&self, hay: impl IntoHaystack<'a, H>) -> bool
where H: HaystackOf<'a, I> { ... }
fn contains_match<'a, H>(&self, hay: impl IntoHaystack<'a, H>) -> bool
where H: HaystackOf<'a, I> { ... }
fn count_matches<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> usize
where H: HaystackOf<'a, I> { ... }
fn range_of_match<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Range<usize>>
where H: HaystackOf<'a, I> { ... }
fn range_of_all_matches<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> RangeOfAllMatches<'a, I, H, Self::Pattern> ⓘ
where H: HaystackOf<'a, I> { ... }
fn slice_match<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<<H as HaystackIter<'a>>::Slice>
where H: HaystackOf<'a, I> { ... }
fn slice_all_matches<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> SliceAllMatches<'a, I, H, Self::Pattern> ⓘ
where H: HaystackOf<'a, I> { ... }
fn do_capture<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, <H as HaystackIter<'a>>::Slice>>
where H: HaystackOf<'a, I> { ... }
fn find_capture<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, <H as HaystackIter<'a>>::Slice>>
where H: HaystackOf<'a, I> { ... }
fn find_all_captures<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> FindAllCaptures<'a, Self, I, H, N> ⓘ
where H: HaystackOf<'a, I> { ... }
fn replace<'a, M>(
&self,
hay_mut: &mut M,
with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice,
) -> bool
where M: OwnedHaystackable<I> { ... }
fn replace_all<'a, M>(
&self,
hay_mut: &mut M,
with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice,
) -> usize
where M: OwnedHaystackable<I> { ... }
fn replace_all_using<M>(
&self,
hay_mut: &mut M,
using: impl FnMut() -> M,
) -> usize
where M: OwnedHaystackable<I> { ... }
fn replace_captured<M, F>(&self, 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 HaystackIter<'a>>::Slice>) -> M { ... }
fn replace_all_captured<M, F>(&self, 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 HaystackIter<'a>>::Slice>) -> M { ... }
}Expand description
A trait that is automatically implemented for ‘anonymous’ regular expression types. There is
only one difference between this and Regex: all functions take self as the first parameter,
removing the need to name the expression itself.
An AnonRegex can be created by invoking regex!() without a type identifier or visibility.
The result is an instance of an unnamable type implementing AnonRegex.
Provided Methods§
Sourcefn is_match<'a, H>(&self, hay: impl IntoHaystack<'a, H>) -> boolwhere
H: HaystackOf<'a, I>,
fn is_match<'a, H>(&self, hay: impl IntoHaystack<'a, H>) -> boolwhere
H: HaystackOf<'a, I>,
See Regex::is_match.
Sourcefn contains_match<'a, H>(&self, hay: impl IntoHaystack<'a, H>) -> boolwhere
H: HaystackOf<'a, I>,
fn contains_match<'a, H>(&self, hay: impl IntoHaystack<'a, H>) -> boolwhere
H: HaystackOf<'a, I>,
Sourcefn count_matches<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> usizewhere
H: HaystackOf<'a, I>,
fn count_matches<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> usizewhere
H: HaystackOf<'a, I>,
See Regex::count_matches.
Sourcefn range_of_match<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Range<usize>>where
H: HaystackOf<'a, I>,
fn range_of_match<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Range<usize>>where
H: HaystackOf<'a, I>,
Sourcefn range_of_all_matches<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> RangeOfAllMatches<'a, I, H, Self::Pattern> ⓘwhere
H: HaystackOf<'a, I>,
fn range_of_all_matches<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> RangeOfAllMatches<'a, I, H, Self::Pattern> ⓘwhere
H: HaystackOf<'a, I>,
Sourcefn slice_match<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<<H as HaystackIter<'a>>::Slice>where
H: HaystackOf<'a, I>,
fn slice_match<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<<H as HaystackIter<'a>>::Slice>where
H: HaystackOf<'a, I>,
See Regex::slice_match.
Sourcefn slice_all_matches<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> SliceAllMatches<'a, I, H, Self::Pattern> ⓘwhere
H: HaystackOf<'a, I>,
fn slice_all_matches<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> SliceAllMatches<'a, I, H, Self::Pattern> ⓘwhere
H: HaystackOf<'a, I>,
Sourcefn do_capture<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, <H as HaystackIter<'a>>::Slice>>where
H: HaystackOf<'a, I>,
fn do_capture<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, <H as HaystackIter<'a>>::Slice>>where
H: HaystackOf<'a, I>,
See Regex::do_capture.
Sourcefn find_capture<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, <H as HaystackIter<'a>>::Slice>>where
H: HaystackOf<'a, I>,
fn find_capture<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, <H as HaystackIter<'a>>::Slice>>where
H: HaystackOf<'a, I>,
See Regex::find_capture.
Sourcefn find_all_captures<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> FindAllCaptures<'a, Self, I, H, N> ⓘwhere
H: HaystackOf<'a, I>,
fn find_all_captures<'a, H>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> FindAllCaptures<'a, Self, I, H, N> ⓘwhere
H: HaystackOf<'a, I>,
Sourcefn replace<'a, M>(
&self,
hay_mut: &mut M,
with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice,
) -> boolwhere
M: OwnedHaystackable<I>,
fn replace<'a, M>(
&self,
hay_mut: &mut M,
with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice,
) -> boolwhere
M: OwnedHaystackable<I>,
See Regex::replace.
Sourcefn replace_all<'a, M>(
&self,
hay_mut: &mut M,
with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice,
) -> usizewhere
M: OwnedHaystackable<I>,
fn replace_all<'a, M>(
&self,
hay_mut: &mut M,
with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice,
) -> usizewhere
M: OwnedHaystackable<I>,
See Regex::replace_all.
Sourcefn replace_all_using<M>(
&self,
hay_mut: &mut M,
using: impl FnMut() -> M,
) -> usizewhere
M: OwnedHaystackable<I>,
fn replace_all_using<M>(
&self,
hay_mut: &mut M,
using: impl FnMut() -> M,
) -> usizewhere
M: OwnedHaystackable<I>,
Sourcefn replace_captured<M, F>(&self, hay_mut: &mut M, replacer: F) -> boolwhere
M: OwnedHaystackable<I>,
F: for<'a> FnOnce(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice>) -> M,
fn replace_captured<M, F>(&self, hay_mut: &mut M, replacer: F) -> boolwhere
M: OwnedHaystackable<I>,
F: for<'a> FnOnce(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice>) -> M,
Sourcefn replace_all_captured<M, F>(&self, hay_mut: &mut M, replacer: F) -> usizewhere
M: OwnedHaystackable<I>,
F: for<'a> FnMut(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice>) -> M,
fn replace_all_captured<M, F>(&self, hay_mut: &mut M, replacer: F) -> usizewhere
M: OwnedHaystackable<I>,
F: for<'a> FnMut(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice>) -> M,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.