pub trait ByteSubstringMut: Sealed {
// Required methods
fn remove_first_substring(
&mut self,
needle: impl AsRef<[u8]>,
) -> Option<Range<usize>>;
fn replace_all_bytes(&mut self, needle: u8, replacement: u8);
}Expand description
Similar to ByteSubstring but requires the input byte string to be
mutable.
Required Methods§
Sourcefn remove_first_substring(
&mut self,
needle: impl AsRef<[u8]>,
) -> Option<Range<usize>>
fn remove_first_substring( &mut self, needle: impl AsRef<[u8]>, ) -> Option<Range<usize>>
If the substring is found, the first instance is removed and index range
of the removed substring is returned, otherwise None. Searches in
the forward direction.
Sourcefn replace_all_bytes(&mut self, needle: u8, replacement: u8)
fn replace_all_bytes(&mut self, needle: u8, replacement: u8)
Replace a single byte of the stored sequence. See the Recode trait
for a more wholistic approach.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".