pub struct TransparentTestMemory { /* private fields */ }Expand description
A memory provider that simply delegates 1:1 to the Rust global allocator.
This is meant for test scenarios where the minimal set of memory provider functionality is desired, to establish maximally controlled conditions.
For general-purpose public use, the GlobalPool should be used instead,
as it is geared for actual efficiency - this here is just a simple passthrough implementation.
Implementations§
Source§impl TransparentTestMemory
impl TransparentTestMemory
Sourcepub fn reserve(&self, len: usize) -> BytesBuf
pub fn reserve(&self, len: usize) -> BytesBuf
Reserves len bytes of mutable memory, returning an empty
BytesBuf whose capacity is backed by the reserved memory.
The memory reservation request will always be fulfilled, obtaining more memory from the operating system if necessary.
§Zero-sized reservations
Reserving zero bytes of memory is a valid operation and will return a BytesBuf
with zero or more bytes of capacity.
§Panics
May panic if the operating system runs out of memory.
Trait Implementations§
Source§impl Clone for TransparentTestMemory
impl Clone for TransparentTestMemory
Source§fn clone(&self) -> TransparentTestMemory
fn clone(&self) -> TransparentTestMemory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more