Struct regex::NoExpand
pub struct NoExpand<'t>(pub &'t str);
Documentation
NoExpand
indicates literal string replacement.
It can be used with replace
and replace_all
to do a literal string
replacement without expanding $name
to their corresponding capture
groups. This can be both convenient (to avoid escaping $
, for example)
and performant (since capture groups don’t need to be found).
't
is the lifetime of the literal text.
Fields
pub 0: &'t str
Trait Implementations
impl<'t> Debug for NoExpand<'t>
fn fmt(&Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl<'t> Replacer for NoExpand<'t>
fn replace_append(
&mut Self,
_: &Captures<'_>,
dst: &mut String
)
fn no_expansion(&mut Self) -> Option<Cow<'_, str>>
Auto Trait Implementations
impl<'t> RefUnwindSafe for NoExpand<'t>
impl<'t> UnwindSafe for NoExpand<'t>
Blanket Implementations
impl<T> BorrowMut<T> for T
where
T: ?Sized,
where
T: ?Sized,
fn borrow_mut(&mut Self) -> &mut T