Trait scratchpad::Tracking
[−]
[src]
pub trait Tracking: Sized { fn capacity(&self) -> usize; fn set(&mut self, index: usize, value: usize); fn get(&self, index: usize) -> usize; }
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
fn capacity(&self) -> usize
Returns the total number of allocations that can be stored in this container.
fn set(&mut self, index: usize, value: usize)
Stores a value at the specified index.
fn get(&self, index: usize) -> usize
Retrieves the value from the specified index.
Implementors
impl<T> Tracking for T where
T: Buffer,