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§
Sourcefn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Returns a mutable byte slice of the buffer contents.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T> Buffer for Box<[T]>where
T: ByteData,
Available on crate features alloc or std or unstable only.
impl<T> Buffer for Box<[T]>where
T: ByteData,
Available on crate features
alloc or std or unstable only.