Trait Buffer

Source
pub trait Buffer {
    // Required methods
    fn as_bytes(&self) -> &[u8] ;
    fn as_bytes_mut(&mut self) -> &mut [u8] ;
}
Expand description

Trait for Scratchpad buffer types.

Buffer objects contain the memory from which Scratchpad allocations are made. Scratchpad handles all bookkeeping, so a buffer only needs to provide methods for raw access of the buffer memory.

Required Methods§

Source

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

Returns a byte slice of the buffer contents.

Source

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

Returns a mutable byte slice of the buffer contents.

Implementations on Foreign Types§

Source§

impl<'a, T> Buffer for &'a mut [T]
where T: ByteData,

Source§

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

Source§

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

Source§

impl<T> Buffer for Box<[T]>
where T: ByteData,

Source§

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

Source§

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

Implementors§

Source§

impl<T> Buffer for T
where T: Array, <T as Array>::Item: ByteData,