Skip to main content

WriteOutcome

Struct WriteOutcome 

Source
pub struct WriteOutcome {
    pub num_objects: u32,
    pub pack_id: ObjectId,
    pub bytes_written: u64,
    pub objects_copied_from_pack: usize,
    pub objects_recompressed: usize,
    pub objects_deltified: usize,
    pub thin_bases_offered: usize,
    pub thin_bases_vetoed: usize,
    pub closure_bases_declined: usize,
}
Expand description

What one packfile emission produced.

Filled in from the engine’s own PackStats on the way out of GitServe::emit_pack, so every number is read back off what the engine reported rather than restated from what was asked for.

No Default, and that is a property rather than an omission: ObjectId has none, and an outcome with a zeroed pack id is one that claims a pack was written and cannot name it. gunnar-pack’s own WriteOutcome refused the same shape for the same reason.

Fields§

§num_objects: u32

How many objects the pack contains. Zero is legal.

§pack_id: ObjectId

The pack’s identity: the checksum over every byte preceding it, which is also the pack’s trailing bytes and the pack-<id>.pack name git gives it.

§bytes_written: u64

Total bytes written, header and trailer included.

§objects_copied_from_pack: usize

Objects whose already-deflated pack entry was copied verbatim: no inflate, no deflate, delta chains preserved.

This and the next field are pack-copy’s applied output. A byte count and a wall clock cannot tell a pack-copy from a re-deflate; these two can, and the day an engine starts re-deflating, objects_recompressed climbs instead of a test staying green.

§objects_recompressed: usize

Objects the engine deflated from their decompressed content.

§objects_deltified: usize

Objects emitted as a newly computed delta against another object in the same pack.

Zero on the serve path, which reuses the pushing client’s deltas and has no encoder. It exists because bytes_written alone cannot tell a deltified pack from a whole-object one: on 2026-08-03 the client shipped 407.08 MiB of pack at 0.0% deltified while every byte count, wall clock and correctness test in the tree was green.

§thin_bases_offered: usize

Thin-delta bases the engine offered — entries copied as an OBJ_REF_DELTA naming a base outside this pack.

§Why the offer is counted and not only the refusal

objects_recompressed says how many objects lost their delta, and cannot say how many could have kept it. A voucher that refuses everything and a transfer that had no thin deltas to begin with produce the same recompressed count and are opposite situations. The refusal rate — thin_bases_vetoed over this — is the number that tells them apart, and no other field here can be made to yield it.

§thin_bases_vetoed: usize

Of those, the ones the client_has voucher would not vouch for, whose objects were therefore written whole.

§closure_bases_declined: usize

Deltas a base closure declined because the base it would have named is an object this pack already carries, at a location in another pack of a multi-pack store.

Zero on a single-pack store, on a negotiated fetch and whenever the closure is off.

Trait Implementations§

Source§

impl Clone for WriteOutcome

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for WriteOutcome

Source§

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

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

impl Eq for WriteOutcome

Source§

impl PartialEq for WriteOutcome

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WriteOutcome

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more