Trait HasMutatorBytes

Source
pub trait HasMutatorBytes: HasLen {
    // Required methods
    fn mutator_bytes(&self) -> &[u8] ;
    fn mutator_bytes_mut(&mut self) -> &mut [u8] ;

    // Provided methods
    fn sub_bytes<R>(&self, range: R) -> SubRangeSlice<'_, u8>
       where R: RangeBounds<usize> { ... }
    fn sub_bytes_mut<R>(&mut self, range: R) -> SubRangeMutSlice<'_, u8>
       where R: RangeBounds<usize> { ... }
    fn sub_input<R>(&mut self, range: R) -> BytesSubInput<'_, Self>
       where R: RangeBounds<usize> { ... }
}
Expand description

Contains mutable bytes

Required Methods§

Source

fn mutator_bytes(&self) -> &[u8]

The bytes

Source

fn mutator_bytes_mut(&mut self) -> &mut [u8]

The bytes to mutate

Provided Methods§

Source

fn sub_bytes<R>(&self, range: R) -> SubRangeSlice<'_, u8>
where R: RangeBounds<usize>,

Creates a SubRangeSlice from this input, that can be used to slice a byte array.

Source

fn sub_bytes_mut<R>(&mut self, range: R) -> SubRangeMutSlice<'_, u8>
where R: RangeBounds<usize>,

Creates a SubRangeMutSlice from this input, that can be used to slice a byte array.

Source

fn sub_input<R>(&mut self, range: R) -> BytesSubInput<'_, Self>
where R: RangeBounds<usize>,

Creates a BytesSubInput from this input, that can be used for local mutations.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl HasMutatorBytes for &mut Vec<u8>

Source§

fn mutator_bytes(&self) -> &[u8]

Source§

fn mutator_bytes_mut(&mut self) -> &mut [u8]

Source§

impl HasMutatorBytes for Vec<u8>

Source§

fn mutator_bytes(&self) -> &[u8]

Source§

fn mutator_bytes_mut(&mut self) -> &mut [u8]

Implementors§