Struct rkyv::ser::serializers::ScratchTracker
source · [−]pub struct ScratchTracker<T> { /* private fields */ }
Expand description
A passthrough scratch space allocator that tracks scratch space usage.
Implementations
sourceimpl<T> ScratchTracker<T>
impl<T> ScratchTracker<T>
sourcepub fn max_bytes_allocated(&self) -> usize
pub fn max_bytes_allocated(&self) -> usize
Returns the maximum number of bytes that were concurrently allocated during serialization.
sourcepub fn max_allocations(&self) -> usize
pub fn max_allocations(&self) -> usize
Returns the maximum number of concurrent allocations during serialization.
sourcepub fn max_alignment(&self) -> usize
pub fn max_alignment(&self) -> usize
Returns the maximum alignment of scratch space requested during serialization.
sourcepub fn min_buffer_size(&self) -> usize
pub fn min_buffer_size(&self) -> usize
Returns the minimum buffer size required to serialize the same data.
This calculation takes into account packing efficiency for slab allocated scratch space. It
is not exact, and has an error bound of max_allocations * (max_alignment - 1)
bytes. This
should be suitably small for most use cases.
sourcepub fn min_buffer_size_max_error(&self) -> usize
pub fn min_buffer_size_max_error(&self) -> usize
Returns the maximum error term for the minimum buffer size calculation.
Trait Implementations
sourceimpl<T: Debug> Debug for ScratchTracker<T>
impl<T: Debug> Debug for ScratchTracker<T>
sourceimpl<T: Fallible> Fallible for ScratchTracker<T>
impl<T: Fallible> Fallible for ScratchTracker<T>
sourceimpl<T> From<T> for ScratchTracker<T>
impl<T> From<T> for ScratchTracker<T>
sourceimpl<T: ScratchSpace> ScratchSpace for ScratchTracker<T>
impl<T: ScratchSpace> ScratchSpace for ScratchTracker<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for ScratchTracker<T> where
T: RefUnwindSafe,
impl<T> Send for ScratchTracker<T> where
T: Send,
impl<T> Sync for ScratchTracker<T> where
T: Sync,
impl<T> Unpin for ScratchTracker<T> where
T: Unpin,
impl<T> UnwindSafe for ScratchTracker<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcefn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
fn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more