Trait RawBufferBackendMut

Source
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§

Source

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

Returns a mutable slice to the entire buffer.

Source

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

Returns an immutable slice to the entire buffer.

Source

fn u8_len(&self) -> usize

Returns the total length of the buffer in bytes.

Implementations on Foreign Types§

Source§

impl RawBufferBackendMut for &mut [u8]

Source§

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

Source§

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

Source§

fn u8_len(&self) -> usize

Implementors§