pub trait FragmentedBufferMut: FragmentedBuffer {
    // Required method
    fn with_bytes_mut<R, F>(&mut self, f: F) -> R
       where F: for<'a, 'b> FnOnce(FragmentedBytesMut<'a, 'b>) -> R;

    // Provided methods
    fn zero_range<R>(&mut self, range: R)
       where R: RangeBounds<usize> { ... }
    fn copy_within<R: RangeBounds<usize>>(&mut self, src: R, dst: usize) { ... }
    fn copy_from<B: FragmentedBuffer>(&mut self, other: &B) { ... }
}
Expand description

A FragmentedBuffer with mutable access to its contents.

Required Methods§

source

fn with_bytes_mut<R, F>(&mut self, f: F) -> R
where F: for<'a, 'b> FnOnce(FragmentedBytesMut<'a, 'b>) -> R,

Invokes a callback on a mutable view into this buffer’s contents as FragmentedBytesMut.

Provided Methods§

source

fn zero_range<R>(&mut self, range: R)
where R: RangeBounds<usize>,

Sets all bytes in range to zero.

§Panics

Panics if the provided range is not within the bounds of this FragmentedBufferMut, or if the range is nonsensical (the end precedes the start).

source

fn copy_within<R: RangeBounds<usize>>(&mut self, src: R, dst: usize)

Copies elements from one part of the FragmentedBufferMut to another part of itself.

src is the range within self to copy from. dst is the starting index of the range within self to copy to, which will have the same length as src. The two ranges may overlap. The ends of the two ranges must be less than or equal to self.len().

§Panics

Panics if either the source or destination range is out of bounds, or if src is nonsensical (its end precedes its start).

source

fn copy_from<B: FragmentedBuffer>(&mut self, other: &B)

Copies all the bytes from another FragmentedBuffer other into self.

§Panics

Panics if self.len() != other.len().

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FragmentedBufferMut for Infallible

source§

fn with_bytes_mut<R, F>(&mut self, _f: F) -> R
where F: for<'a, 'b> FnOnce(FragmentedBytesMut<'a, 'b>) -> R,

source§

impl<'a> FragmentedBufferMut for &'a mut [u8]

source§

fn with_bytes_mut<R, F>(&mut self, f: F) -> R
where F: for<'macro_a, 'macro_b> FnOnce(FragmentedBytesMut<'macro_a, 'macro_b>) -> R,

source§

fn zero_range<R>(&mut self, range: R)
where R: RangeBounds<usize>,

source§

fn copy_within<R: RangeBounds<usize>>(&mut self, src: R, dest: usize)

Implementors§