pub struct AllocBuffer;Expand description
Allocates memory using the global allocator.
Trait Implementations§
Source§impl<'a> BufferProvider<'a> for AllocBuffer
impl<'a> BufferProvider<'a> for AllocBuffer
Source§fn provide_buffer(
&mut self,
len: usize,
) -> Result<Self::Buffer, Self::ProvisionError>
fn provide_buffer( &mut self, len: usize, ) -> Result<Self::Buffer, Self::ProvisionError>
Allocates len bytes on the heap
Source§type Buffer = Box<[u8]>
type Buffer = Box<[u8]>
The type returned from a successful buffer provision.
Must implement
AsMut<[u8]> so that it can be borrowed mutably right after allocation for initialization
and Into<Bytes<'a>> for storing.Source§type ProvisionError = Infallible
type ProvisionError = Infallible
The error type returned from a failed buffer provision.