pub struct ReplaceN<S1, S2>(pub S1, pub S2, 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: S1§1: S2§2: usizeTrait Implementations§
impl<S1: Copy, S2: Copy> Copy for ReplaceN<S1, S2>
impl<S1: Eq, S2: Eq> Eq for ReplaceN<S1, S2>
impl<S1: PartialEq, S2: PartialEq> StructuralPartialEq for ReplaceN<S1, S2>
Auto Trait Implementations§
impl<S1, S2> Freeze for ReplaceN<S1, S2>
impl<S1, S2> RefUnwindSafe for ReplaceN<S1, S2>where
S1: RefUnwindSafe,
S2: RefUnwindSafe,
impl<S1, S2> Send for ReplaceN<S1, S2>
impl<S1, S2> Sync for ReplaceN<S1, S2>
impl<S1, S2> Unpin for ReplaceN<S1, S2>
impl<S1, S2> UnsafeUnpin for ReplaceN<S1, S2>where
S1: UnsafeUnpin,
S2: UnsafeUnpin,
impl<S1, S2> UnwindSafe for ReplaceN<S1, S2>where
S1: UnwindSafe,
S2: UnwindSafe,
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.