pub trait FrameBuffer {
type BufferSlice: AsMut<[u8]> + AsRef<[u8]> + Truncate;
// Required method
fn allocate(&mut self, size: usize) -> Result<&mut Self::BufferSlice>;
}Expand description
Representation of a frame buffer which allows to allocate continuous slices of memory as bytes
Already implemented for Vec<u8>
Required Associated Types§
Required Methods§
Sourcefn allocate(&mut self, size: usize) -> Result<&mut Self::BufferSlice>
fn allocate(&mut self, size: usize) -> Result<&mut Self::BufferSlice>
Tries to allocate a continuous slice of memory in the buffer.
If allocation fails an crate::error::SframeError is returned.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".