pub struct MemScratch { /* private fields */ }Expand description
In-memory Scratch: a growable buffer that “freezes” to a borrow of
itself. The reference implementation — it backs tests, and because it
drives the streaming path with no files it is the vehicle for the
disk_first == in_memory property test. It stages in RAM, so
it does not save RAM; a host Scratch over a temp file is what bounds RAM
in practice.
Implementations§
Source§impl MemScratch
impl MemScratch
Trait Implementations§
Source§impl Clone for MemScratch
impl Clone for MemScratch
Source§fn clone(&self) -> MemScratch
fn clone(&self) -> MemScratch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemScratch
impl Debug for MemScratch
Source§impl Default for MemScratch
impl Default for MemScratch
Source§fn default() -> MemScratch
fn default() -> MemScratch
Returns the “default value” for a type. Read more
Source§impl Scratch for MemScratch
impl Scratch for MemScratch
Source§type Error = Infallible
type Error = Infallible
Implementation-specific failure (I/O error, host callback error…).
Source§fn write(&mut self, bytes: &[u8]) -> Result<(), Self::Error>
fn write(&mut self, bytes: &[u8]) -> Result<(), Self::Error>
Appends
bytes to the staging area. Not to be called after
freeze.Auto Trait Implementations§
impl Freeze for MemScratch
impl RefUnwindSafe for MemScratch
impl Send for MemScratch
impl Sync for MemScratch
impl Unpin for MemScratch
impl UnsafeUnpin for MemScratch
impl UnwindSafe for MemScratch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more