pub trait ByteBufferMut: ByteBuffer + AsMut<[u8]> {
Show 16 methods
// Required methods
fn set(&self, at: usize, value: u8);
fn slice_mut(&self) -> &mut [u8] ⓘ;
fn slice_start_mut(&self, start: usize) -> &mut [u8] ⓘ;
fn slice_end_mut(&self, end: usize) -> &mut [u8] ⓘ;
fn slice_both_mut(&self, start: usize, end: usize) -> &mut [u8] ⓘ;
fn split_mut(&self, divide: usize) -> (&mut [u8], &mut [u8]);
fn rebuffer_start(&self, start: usize) -> Self;
fn rebuffer_end(&self, end: usize) -> Self;
fn rebuffer_both(&self, start: usize, end: usize) -> Self;
fn expand_start(&self, size: usize) -> Self;
fn expand_end(&self, size: usize) -> Self;
fn split_buf_start(&self, divide: usize) -> (Self, Self);
fn split_buf_end(&self, divide: usize) -> (Self, Self);
fn append(&self, other: &[u8]) -> Self;
fn prepend(&self, other: &[u8]) -> Self;
fn ensure_size(&self, size: usize) -> Self;
}Expand description
Mutable byte buffer trait for read-write access to buffer data. Only implemented by ManagedByteBuffer (pool-attached, mutable, Send).
Required Methods§
Sourcefn slice_start_mut(&self, start: usize) -> &mut [u8] ⓘ
fn slice_start_mut(&self, start: usize) -> &mut [u8] ⓘ
Get mutable slice from start offset to end.
Sourcefn slice_end_mut(&self, end: usize) -> &mut [u8] ⓘ
fn slice_end_mut(&self, end: usize) -> &mut [u8] ⓘ
Get mutable slice from beginning to end offset.
Sourcefn slice_both_mut(&self, start: usize, end: usize) -> &mut [u8] ⓘ
fn slice_both_mut(&self, start: usize, end: usize) -> &mut [u8] ⓘ
Get mutable slice from start to end offset.
Sourcefn split_mut(&self, divide: usize) -> (&mut [u8], &mut [u8])
fn split_mut(&self, divide: usize) -> (&mut [u8], &mut [u8])
Split into two mutable slices at divide point. Returns (left, right).
Sourcefn rebuffer_start(&self, start: usize) -> Self
fn rebuffer_start(&self, start: usize) -> Self
Create view with start shifted forward by start bytes.
Sourcefn rebuffer_end(&self, end: usize) -> Self
fn rebuffer_end(&self, end: usize) -> Self
Create view with end at end offset from current start.
Sourcefn rebuffer_both(&self, start: usize, end: usize) -> Self
fn rebuffer_both(&self, start: usize, end: usize) -> Self
Create view with both start and end adjusted from current start.
Sourcefn expand_start(&self, size: usize) -> Self
fn expand_start(&self, size: usize) -> Self
Expand view backward by size bytes (into header space).
Sourcefn expand_end(&self, size: usize) -> Self
fn expand_end(&self, size: usize) -> Self
Expand view forward by size bytes (into trailer space).
Sourcefn split_buf_start(&self, divide: usize) -> (Self, Self)
fn split_buf_start(&self, divide: usize) -> (Self, Self)
Split into two buffer views at divide point. Returns (left, right).
Sourcefn split_buf_end(&self, divide: usize) -> (Self, Self)
fn split_buf_end(&self, divide: usize) -> (Self, Self)
Split into two buffer views at len(buffer) - divide point. Returns (left, right).
Sourcefn ensure_size(&self, size: usize) -> Self
fn ensure_size(&self, size: usize) -> Self
Ensure buffer has at least size bytes, expanding or shrinking as needed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".