pub struct StringMatcher<'data> { /* private fields */ }
Expand description
A precompiled regex
Implementations
sourceimpl<'data> StringMatcher<'data>
impl<'data> StringMatcher<'data>
sourcepub const unsafe fn from_dfa_bytes_unchecked(
dfa_bytes: &'data [u8]
) -> StringMatcher<'data>
pub const unsafe fn from_dfa_bytes_unchecked(
dfa_bytes: &'data [u8]
) -> StringMatcher<'data>
Creates a StringMatcher
from a serialized DFA. Used internally by databake.
Safety
dfa_bytes
has to be a valid DFA (regex_automata::dfa::sparse::DFA::from_bytes(dfa_bytes).is_ok())
Trait Implementations
sourceimpl<'_> Bake for StringMatcher<'_>
impl<'_> Bake for StringMatcher<'_>
sourcefn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
Returns a TokenStream
that would evaluate to self
. Read more
sourceimpl<'data> Clone for StringMatcher<'data>
impl<'data> Clone for StringMatcher<'data>
sourcefn clone(&self) -> StringMatcher<'data>
fn clone(&self) -> StringMatcher<'data>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'data> Debug for StringMatcher<'data>
impl<'data> Debug for StringMatcher<'data>
sourceimpl<'de, 'data> Deserialize<'de> for StringMatcher<'data> where
'de: 'data,
impl<'de, 'data> Deserialize<'de> for StringMatcher<'data> where
'de: 'data,
sourcefn deserialize<D>(
deserializer: D
) -> Result<StringMatcher<'data>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<StringMatcher<'data>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'_> PartialEq<StringMatcher<'_>> for StringMatcher<'_>
impl<'_> PartialEq<StringMatcher<'_>> for StringMatcher<'_>
sourceimpl<'_> Serialize for StringMatcher<'_>
impl<'_> Serialize for StringMatcher<'_>
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl<'a> Yokeable<'a> for StringMatcher<'static>
impl<'a> Yokeable<'a> for StringMatcher<'static>
type Output = StringMatcher<'a>
type Output = StringMatcher<'a>
This type MUST be Self
with the 'static
replaced with 'a
, i.e. Self<'a>
sourcefn transform(&'a self) -> &'a <StringMatcher<'static> as Yokeable<'a>>::Output
fn transform(&'a self) -> &'a <StringMatcher<'static> as Yokeable<'a>>::Output
This method must cast self
between &'a Self<'static>
and &'a Self<'a>
. Read more
sourcefn transform_owned(self) -> <StringMatcher<'static> as Yokeable<'a>>::Output
fn transform_owned(self) -> <StringMatcher<'static> as Yokeable<'a>>::Output
This method must cast self
between Self<'static>
and Self<'a>
. Read more
sourceunsafe fn make(
this: <StringMatcher<'static> as Yokeable<'a>>::Output
) -> StringMatcher<'static>
unsafe fn make(
this: <StringMatcher<'static> as Yokeable<'a>>::Output
) -> StringMatcher<'static>
This method can be used to cast away Self<'a>
’s lifetime. Read more
sourcefn transform_mut<F>(&'a mut self, f: F) where
F: 'static + for<'b> FnOnce(&'b mut <StringMatcher<'static> as Yokeable<'a>>::Output),
fn transform_mut<F>(&'a mut self, f: F) where
F: 'static + for<'b> FnOnce(&'b mut <StringMatcher<'static> as Yokeable<'a>>::Output),
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read more
sourceimpl<'zf, 'zf_inner> ZeroFrom<'zf, StringMatcher<'zf_inner>> for StringMatcher<'zf>
impl<'zf, 'zf_inner> ZeroFrom<'zf, StringMatcher<'zf_inner>> for StringMatcher<'zf>
sourcefn zero_from(this: &'zf StringMatcher<'zf_inner>) -> StringMatcher<'zf>
fn zero_from(this: &'zf StringMatcher<'zf_inner>) -> StringMatcher<'zf>
Clone the other C
into a struct that may retain references into C
.
impl<'a> IsCovariant<'a> for StringMatcher<'a>
Auto Trait Implementations
impl<'data> RefUnwindSafe for StringMatcher<'data>
impl<'data> Send for StringMatcher<'data>
impl<'data> Sync for StringMatcher<'data>
impl<'data> Unpin for StringMatcher<'data>
impl<'data> UnwindSafe for StringMatcher<'data>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Serialize for T where
T: Serialize + ?Sized,
impl<T> Serialize for T where
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more