Skip to main content

NewestFirst

Struct NewestFirst 

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

A shard’s runs from the highest run number down: the newest start first, since a shard numbers its runs in the order they start. (After a reshard, runs that had to be renumbered count as newer than they are.)

Batches let the caller release the shard between them. The cursor probes each number below the last one issued, so the newest k runs cost about k lookups; once probing has cost two passes over the table (old numbers mostly expired), it sorts the runs left instead. Runs started after the cursor was made are not visited; a run removed meanwhile may still be returned once.

Implementations§

§

impl NewestFirst

pub fn next_batch(&mut self, core: &ShardCore, n: usize) -> Vec<RunId> ⓘ

The next at most n runs.

Trait Implementations§

§

impl Debug for NewestFirst

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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.