pub struct Input<'h, HaystackStr = str>where
HaystackStr: EncodedStr + ?Sized,{ /* private fields */ }
Implementations§
Source§impl<'h, HaystackStr> Input<'h, HaystackStr>where
HaystackStr: EncodedStr + ?Sized,
impl<'h, HaystackStr> Input<'h, HaystackStr>where
HaystackStr: EncodedStr + ?Sized,
Sourcepub fn builder(haystack: &'h HaystackStr) -> InputBuilder<'h, HaystackStr>
pub fn builder(haystack: &'h HaystackStr) -> InputBuilder<'h, HaystackStr>
Create an instance of Input
using the builder syntax
Source§impl<'h> Input<'h, str>
impl<'h> Input<'h, str>
Sourcepub fn from_regex(input: &Input<'h>) -> Self
Available on crate feature regex-automata
only.
pub fn from_regex(input: &Input<'h>) -> Self
regex-automata
only.Note that:
span
can limit the range, but the retuenedMatch
fromIbMatcher
will start fromspan.start
. You need to callm.offset(input.start())
manually if the offsets matter in your case.anchored
andearliest
will be ignored.
Trait Implementations§
Source§impl<'h, HaystackStr> From<&'h HaystackStr> for Input<'h, HaystackStr>where
HaystackStr: EncodedStr + ?Sized,
impl<'h, HaystackStr> From<&'h HaystackStr> for Input<'h, HaystackStr>where
HaystackStr: EncodedStr + ?Sized,
Source§fn from(haystack: &'h HaystackStr) -> Self
fn from(haystack: &'h HaystackStr) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'h, HaystackStr> Freeze for Input<'h, HaystackStr>where
HaystackStr: ?Sized,
impl<'h, HaystackStr> RefUnwindSafe for Input<'h, HaystackStr>where
HaystackStr: RefUnwindSafe + ?Sized,
impl<'h, HaystackStr> Send for Input<'h, HaystackStr>
impl<'h, HaystackStr> Sync for Input<'h, HaystackStr>
impl<'h, HaystackStr> Unpin for Input<'h, HaystackStr>where
HaystackStr: ?Sized,
impl<'h, HaystackStr> UnwindSafe for Input<'h, HaystackStr>where
HaystackStr: RefUnwindSafe + ?Sized,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more