pub enum DeltaBase {
None,
Offset(u64),
Ref(Vec<u8>),
}Expand description
Where a delta entry’s base is.
The stored form is an OFFSET, never an ordinal (§13, decided): an ordinal indexes the derived objects table, that table is rebuilt whenever the projection is rebuilt, and a rebuild re-derives every ordinal as the new oid-lexicographic rank. An ordinal written down before a rebuild therefore points at a different row afterwards — silently. An offset addresses the bytes, which append-only storage never moves.
Variants§
None
A whole object: no base.
Offset(u64)
OFS_DELTA — the base is another entry, at this absolute offset.
Absolute in whatever coordinate space the walk was rebased into: within
the pack after walk, within the archive after PackWalk::rebased.
Ref(Vec<u8>)
REF_DELTA — the base is named by oid and is usually outside the pack
(that is what a thin pack is). Resolving it is the one part of the check
that reads objects.oid, exactly as §13’s table says receive-pack does.
Implementations§
Source§impl DeltaBase
impl DeltaBase
Sourcepub fn as_offset(&self) -> u64
pub fn as_offset(&self) -> u64
The offset form for the objects.delta_base column.
0 means no offset base and is a safe sentinel rather than a lie:
archive offset 0 is the first pack’s PACK magic, so no object entry can
ever legitimately start there. A Ref base has no offset until the
indexer resolves its oid, and reports 0 for the same reason.
Trait Implementations§
impl Eq for DeltaBase
impl StructuralPartialEq for DeltaBase
Auto Trait Implementations§
impl Freeze for DeltaBase
impl RefUnwindSafe for DeltaBase
impl Send for DeltaBase
impl Sync for DeltaBase
impl Unpin for DeltaBase
impl UnsafeUnpin for DeltaBase
impl UnwindSafe for DeltaBase
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.