pub struct PackPlan {
pub raw: Vec<Hash>,
pub deltas: Vec<PlannedDelta>,
pub self_contained: bool,
}Expand description
A deterministic plan for the pack(s) a push uploads for one ref — serialised into a single pack when it fits under the payload cap, or split across several when it doesn’t (issue #831).
Entries are pre-ordered for crate::pack::PackWriter: all raw
objects first (non-blobs before blobs, each group in BLAKE3 order),
then deltas. Delta bases are external — they live in old_tip’s
closure, which the remote already holds and earlier packs already
delivered, NEVER in an entry introduced earlier in this same plan —
so no in-pack base ordering is required (SPEC-PACKFILE §4), and a
left-to-right split of this sequence across multiple packs is always
safe.
Fields§
§raw: Vec<Hash>Objects to send verbatim, already ordered non-blobs-then-blobs.
deltas: Vec<PlannedDelta>Objects to send as a delta against an already-present base.
self_contained: booltrue when the pack needs no externally-resolved base — i.e. this is
a full-closure push (no usable old_tip), so the pack reconstructs
the ref’s whole closure on its own. The push path normally appends
this pack to the branch’s packlist chain; it uses self_contained
to decide whether a push may reset to a fresh chain, in two
cases:
- Reactively, when the prior chain is unreadable — a self-contained pack is the one kind that can safely escape a broken chain.
- Proactively (#406): when a healthy chain has simply grown past
the re-baseline depth threshold, the push side calls
plan_packwithold_tip: Nonespecifically to forceself_contained: true, then resets the chain to bound its depth. This reuses the atomic head+packmap advance (#408) the reactive reset already depends on — no separate mechanism was needed once that landed.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PackPlan
impl RefUnwindSafe for PackPlan
impl Send for PackPlan
impl Sync for PackPlan
impl Unpin for PackPlan
impl UnsafeUnpin for PackPlan
impl UnwindSafe for PackPlan
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
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more