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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.