pub struct ReplaceN<'a>(pub &'a str, pub &'a str, pub usize);
Expand description
ReplaceN(old, new, n)
replaces first n
matches old
with new
.
assert_eq!(ReplaceN("foo", "bar", 1).rewrite("foofoo"), "barfoo");
assert_eq!(ReplaceN("foo", "bar", 3).rewrite("foofoo"), "barbar");
Tuple Fields§
§0: &'a str
§1: &'a str
§2: usize
Trait Implementations§
Source§impl PathRewriter for ReplaceN<'_>
impl PathRewriter for ReplaceN<'_>
impl<'a> Copy for ReplaceN<'a>
impl<'a> Eq for ReplaceN<'a>
impl<'a> StructuralPartialEq for ReplaceN<'a>
Auto Trait Implementations§
impl<'a> Freeze for ReplaceN<'a>
impl<'a> RefUnwindSafe for ReplaceN<'a>
impl<'a> Send for ReplaceN<'a>
impl<'a> Sync for ReplaceN<'a>
impl<'a> Unpin for ReplaceN<'a>
impl<'a> UnwindSafe for ReplaceN<'a>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.