pub trait AnonRegex<I: HaystackItem, const N: usize>: Regex<I, N> {
Show 15 methods
// Provided methods
fn is_match<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> bool { ... }
fn contains_match<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> bool { ... }
fn count_matches<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> usize { ... }
fn range_of_match<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Range<usize>> { ... }
fn range_of_all_matches<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> RangeOfAllMatches<'a, I, H, Self::Pattern> ⓘ { ... }
fn slice_match<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<H::Slice> { ... }
fn slice_all_matches<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> SliceAllMatches<'a, I, H, Self::Pattern> ⓘ { ... }
fn do_capture<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, H::Slice>> { ... }
fn find_capture<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, H::Slice>> { ... }
fn find_all_captures<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> FindAllCaptures<'a, Self, I, H, N> ⓘ { ... }
fn replace<'a, M: OwnedHaystackable<I>>(
&self,
hay_mut: &mut M,
with: <M::Hay<'a> as HaystackIter<'a>>::Slice,
) -> bool { ... }
fn replace_all<'a, M: OwnedHaystackable<I>>(
&self,
hay_mut: &mut M,
with: <M::Hay<'a> as HaystackIter<'a>>::Slice,
) -> usize { ... }
fn replace_all_using<M: OwnedHaystackable<I>>(
&self,
hay_mut: &mut M,
using: impl FnMut() -> M,
) -> usize { ... }
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::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::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: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> bool
fn is_match<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> bool
See Regex::is_match.
Sourcefn contains_match<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> bool
fn contains_match<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> bool
Sourcefn count_matches<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> usize
fn count_matches<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> usize
See Regex::count_matches.
Sourcefn range_of_match<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Range<usize>>
fn range_of_match<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Range<usize>>
Sourcefn range_of_all_matches<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> RangeOfAllMatches<'a, I, H, Self::Pattern> ⓘ
fn range_of_all_matches<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> RangeOfAllMatches<'a, I, H, Self::Pattern> ⓘ
Sourcefn slice_match<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<H::Slice>
fn slice_match<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<H::Slice>
See Regex::slice_match.
Sourcefn slice_all_matches<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> SliceAllMatches<'a, I, H, Self::Pattern> ⓘ
fn slice_all_matches<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> SliceAllMatches<'a, I, H, Self::Pattern> ⓘ
Sourcefn do_capture<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, H::Slice>>
fn do_capture<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, H::Slice>>
See Regex::do_capture.
Sourcefn find_capture<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, H::Slice>>
fn find_capture<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, H::Slice>>
See Regex::find_capture.
Sourcefn find_all_captures<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> FindAllCaptures<'a, Self, I, H, N> ⓘ
fn find_all_captures<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> FindAllCaptures<'a, Self, I, H, N> ⓘ
Sourcefn replace<'a, M: OwnedHaystackable<I>>(
&self,
hay_mut: &mut M,
with: <M::Hay<'a> as HaystackIter<'a>>::Slice,
) -> bool
fn replace<'a, M: OwnedHaystackable<I>>( &self, hay_mut: &mut M, with: <M::Hay<'a> as HaystackIter<'a>>::Slice, ) -> bool
See Regex::replace.
Sourcefn replace_all<'a, M: OwnedHaystackable<I>>(
&self,
hay_mut: &mut M,
with: <M::Hay<'a> as HaystackIter<'a>>::Slice,
) -> usize
fn replace_all<'a, M: OwnedHaystackable<I>>( &self, hay_mut: &mut M, with: <M::Hay<'a> as HaystackIter<'a>>::Slice, ) -> usize
See Regex::replace_all.
Sourcefn replace_all_using<M: OwnedHaystackable<I>>(
&self,
hay_mut: &mut M,
using: impl FnMut() -> M,
) -> usize
fn replace_all_using<M: OwnedHaystackable<I>>( &self, hay_mut: &mut M, using: impl FnMut() -> M, ) -> usize
Sourcefn replace_captured<M, F>(&self, hay_mut: &mut M, replacer: F) -> boolwhere
M: OwnedHaystackable<I>,
F: for<'a> FnOnce(Self::Capture<'a, <M::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::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::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::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.