Enum git_odb::store::iter::Ordering

source ·
pub enum Ordering {
    PackLexicographicalThenLooseLexicographical,
    PackAscendingOffsetThenLooseLexicographical,
}
Expand description

Define the order in which objects are returned.

Variants§

§

PackLexicographicalThenLooseLexicographical

Traverse packs first as sorted by their index files in lexicographical order (sorted by object id), then traverse loose objects as sorted by their names as well.

This mode uses no memory as it’s the natural ordering of objects, and is best to obtain all object ids as quickly as possible, while noting that these may contain duplicates. However, it’s very costly to obtain object information or decode them with this scheme as cache-hits are unlikely with it and memory maps are less efficient when loading them in random order.

§

PackAscendingOffsetThenLooseLexicographical

Traverse packs first yielding object ids sorted by their position in the pack, with those at the beginning of the pack file coming first. Then follow loose objects sorted by their names.

This mode allocates and as to pre-sort objects by their offsets, delaying the start of the iteration once per pack while keeping memory allocated once per pack. This price is usually worth paying once querying object information is planned as pack caches are more efficiently used that way.

Trait Implementations§

source§

impl Clone for Ordering

source§

fn clone(&self) -> Ordering

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ordering

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Ordering

source§

fn default() -> Self

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

impl Copy for Ordering

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.