Skip to main content

EmitEntry

Struct EmitEntry 

Source
pub struct EmitEntry {
    pub oid: Vec<u8>,
    pub stored: EntryBytes,
    pub obj_type: ObjType,
    pub uncompressed_size: u64,
    pub delta_base: u64,
    pub offset: u64,
    pub recompressed: bool,
    pub deltified: bool,
}
Expand description

One object to emit: where its stored entry is, and what it deltas against.

Fields§

§oid: Vec<u8>

The object id, for REF_DELTA rewriting and for reporting.

§stored: EntryBytes

The bytes this entry contributes — header and all.

Normally an EntryBytes::Extent: the stored entry exactly as received, addressed and not copied. For the entry shapes that cannot be shipped verbatim — chiefly a delta whose base the caller is not sending — crate::git_ops::GitStore::emit_set rebuilds the bytes from the resolved object, hands them over as EntryBytes::Owned, and says so in Self::recompressed.

§obj_type: ObjType

The entry type of stored, so a copied delta is OfsDelta/RefDelta and a rebuilt one is the resolved type.

§uncompressed_size: u64

Post-resolution size, which is what the entry header carries.

§delta_base: u64

The base’s archive offset, 0 for none.

§offset: u64

This entry’s own archive offset — the key other entries name it by.

§recompressed: bool

stored was rebuilt rather than copied, so its payload was inflated and re-deflated.

Carried on the entry rather than inferred at emission because nothing downstream can tell one zlib stream from another: a re-deflate and a copy produce packs that both pass git index-pack --strict and differ only in the CPU they cost. This flag is what makes EmitReport::recompressed a count of what happened instead of a hopeful zero.

§deltified: bool

stored is a delta this server COMPUTED, against a base the request does carry — rather than the whole object.

A strict refinement of Self::recompressed, never set without it: such an entry really was inflated and re-deflated, so it is not copied and must not be counted as one. What it adds is which rebuild happened, because the two differ by ~4× on the wire and the receipt is the only place that difference is visible — a whole rebuild and a computed delta both pass index-pack --strict and fsck.

Zero for a full clone, for the same reason recompressed is: a whole-repository request contains every base, so nothing is rebuilt at all. See crate::delta.

Trait Implementations§

Source§

impl Clone for EmitEntry

Source§

fn clone(&self) -> EmitEntry

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 EmitEntry

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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, 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.