pub trait Tracking: Sized {
// Required methods
fn capacity(&self) -> usize;
fn set(&mut self, index: usize, value: usize);
fn get(&self, index: usize) -> usize;
}
Expand description
Trait for Scratchpad
allocation tracking containers.
Each Marker
is tracked within a Scratchpad
using only a single
usize
value per allocation. Actual storage of such values can be
implemented in any manner (memory does not need to be contiguous, for
instance).
Scratchpad
and Marker
will never call get()
for a given index
if set()
has not been previously called for the same index, so values
can be left uninitialized prior to set()
calls.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.