Trait Tracking

Source
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§

Source

fn capacity(&self) -> usize

Returns the total number of allocations that can be stored in this container.

Source

fn set(&mut self, index: usize, value: usize)

Stores a value at the specified index.

Source

fn get(&self, index: usize) -> usize

Retrieves the value from the specified index.

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.

Implementors§

Source§

impl<T> Tracking for T
where T: Buffer,