Skip to main content

RunTable

Struct RunTable 

pub struct RunTable { /* private fields */ }
Expand description

See the module documentation.

Implementations§

§

impl RunTable

pub fn new() -> Self

pub fn len(&self) -> usize

pub fn is_empty(&self) -> bool

pub fn used(&self) -> u32

Slots handed out, live or free: the range a sweep walks.

pub fn heap_bytes(&self) -> usize

Heap bytes held by the table and its indexes.

pub fn get(&self, slot: Slot) -> &Entry

pub fn get_mut(&mut self, slot: Slot) -> &mut Entry

pub fn live_at(&self, slot: Slot) -> Option<&Entry>

A live entry at slot, if the slot is in use.

pub fn find_run(&self, run: RunId) -> Option<Slot>

pub fn has_run(&self, run: RunId) -> bool

Whether run has an entry. Unlike find_run it leaves the recent-lookup cache alone: a listing probes many numbers, and the step path’s cache should not pay for it.

pub fn find_id(&self, id_hash: u64) -> Option<Slot>

The latest run of the ID with this hash.

pub fn insert(&mut self, e: Entry) -> Slot

Adds an entry for a run not in the table. The ID index is separate: see index_id.

pub fn index_id(&mut self, slot: Slot)

Makes slot the entry its ID hash finds, unless a later run of the same ID holds the place (the latest run for an ID wins).

pub fn remove(&mut self, slot: Slot) -> Entry

pub fn iter(&self) -> impl Iterator<Item = (Slot, &Entry)> + '_

Live entries in slot order.

pub fn reserve(&mut self, n: usize)

Makes room for n more entries (bulk loading).

pub fn compact(&mut self) -> bool

Moves entries into the holes left by removed ones when at least three quarters of the slots are free, and gives back the chunks emptied. Slots change: returns whether anything moved.

Trait Implementations§

§

impl Default for RunTable

§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.