Trait rkyv::ser::ScratchSpace[][src]

pub trait ScratchSpace: Fallible {
    unsafe fn push_scratch(
        &mut self,
        layout: Layout
    ) -> Result<NonNull<[u8]>, Self::Error>;
unsafe fn pop_scratch(
        &mut self,
        ptr: NonNull<u8>,
        layout: Layout
    ) -> Result<(), Self::Error>; }
Expand description

A serializer that can allocate scratch space.

Required methods

Allocates scratch space of the requested size.


layout must have non-zero size.

Deallocates previously allocated scratch space.


  • ptr must be the scratch memory last allocated with push_scratch.
  • layout must be the same layout that was used to allocate that block of memory.