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§
impl Copy for Ordering
Auto Trait Implementations§
impl Freeze for Ordering
impl RefUnwindSafe for Ordering
impl Send for Ordering
impl Sync for Ordering
impl Unpin for Ordering
impl UnwindSafe for Ordering
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)