pub trait RawBufferBackendMut {
// Required methods
fn as_mut_u8_slice(&mut self) -> &mut [u8];
fn as_u8_slice(&self) -> &[u8];
fn u8_len(&self) -> usize;
}
Expand description
A trait for abstracting over a mutable byte buffer.
This allows RawFrameBuf
to be agnostic to the underlying buffer’s storage,
accepting anything that can provide a mutable byte slice, such as a &mut [u8]
,
a Vec<u8>
, or a custom memory-mapped region.
Required Methods§
Sourcefn as_mut_u8_slice(&mut self) -> &mut [u8]
fn as_mut_u8_slice(&mut self) -> &mut [u8]
Returns a mutable slice to the entire buffer.
Sourcefn as_u8_slice(&self) -> &[u8]
fn as_u8_slice(&self) -> &[u8]
Returns an immutable slice to the entire buffer.