#[non_exhaustive]pub enum ReplaceCount {
All,
FirstPerLine,
FirstInFile,
Max(usize),
}Expand description
How many occurrences a Replace operation substitutes.
Wire format (externally tagged): unit variants serialize as plain
strings ("all", "first_per_line", "first_in_file"), the capped
variant as an object ({"max": 3}, counting occurrences per file).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
All
Replace every occurrence (sed s///g, the default).
FirstPerLine
Replace only the first occurrence on each matching line (sed s///).
FirstInFile
Replace only the first occurrence in the file, then stop.
Max(usize)
Replace at most N occurrences in the file, then stop.
Trait Implementations§
Source§impl Clone for ReplaceCount
impl Clone for ReplaceCount
Source§fn clone(&self) -> ReplaceCount
fn clone(&self) -> ReplaceCount
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ReplaceCount
Source§impl Debug for ReplaceCount
impl Debug for ReplaceCount
Source§impl Default for ReplaceCount
impl Default for ReplaceCount
Source§fn default() -> ReplaceCount
fn default() -> ReplaceCount
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ReplaceCount
impl<'de> Deserialize<'de> for ReplaceCount
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ReplaceCount
Source§impl PartialEq for ReplaceCount
impl PartialEq for ReplaceCount
Source§fn eq(&self, other: &ReplaceCount) -> bool
fn eq(&self, other: &ReplaceCount) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ReplaceCount
impl Serialize for ReplaceCount
impl StructuralPartialEq for ReplaceCount
Auto Trait Implementations§
impl Freeze for ReplaceCount
impl RefUnwindSafe for ReplaceCount
impl Send for ReplaceCount
impl Sync for ReplaceCount
impl Unpin for ReplaceCount
impl UnsafeUnpin for ReplaceCount
impl UnwindSafe for ReplaceCount
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