Skip to main content

PackBuildOptions

Struct PackBuildOptions 

Source
pub struct PackBuildOptions {
    pub thin: bool,
    pub delta: bool,
    pub window: usize,
    pub max_depth: usize,
    pub use_ofs_delta: bool,
    pub respect_islands: bool,
    pub reuse_deltas: bool,
    pub reuse_objects: bool,
    pub use_bitmaps: bool,
}
Expand description

Options controlling pack-objects output (also used by build_pack).

Fields§

§thin: bool

Build a thin pack: allow deltas whose base is reachable from the haves but not emitted in the pack (REF_DELTA against a peer-held base).

§delta: bool

Emit delta-compressed objects instead of whole objects only.

§window: usize

Candidate bases per object (Git --window). 0 disables new deltas.

§max_depth: usize

Maximum delta chain depth (Git --depth). 0 stores whole objects.

§use_ofs_delta: bool

Prefer OFS_DELTA when the base precedes the target in the pack stream.

§respect_islands: bool

Honor pack.island delta-island rules when selecting bases.

§reuse_deltas: bool

Reuse on-disk delta edges when both target and base are in this pack.

§reuse_objects: bool

Reuse verbatim packed bytes for whole objects (CRC32-guarded v2 indexes).

§use_bitmaps: bool

Use pack reachability bitmaps for object enumeration when present.

Implementations§

Source§

impl PackBuildOptions

Source

pub fn window_and_depth_from_config(cfg: Option<&ConfigSet>) -> (usize, usize)

pack.window and pack.depth from config, or Git defaults when unset.

Source

pub fn for_local_copy(cfg: Option<&ConfigSet>) -> Self

Production pack settings for a local full copy (clone/fetch from disk).

Source

pub fn for_repack_rewrite(cfg: Option<&ConfigSet>) -> Self

Copy stored pack entries (whole objects and deltas) without a new delta search (window 0), for rebuilding a pack from objects that are already packed.

Source

pub fn for_serve( cfg: Option<&ConfigSet>, thin: bool, use_ofs_delta: bool, ) -> Self

Pack settings for answering a fetch (upload-pack).

Window and depth follow pack.window / pack.depth. Whole objects and deltas already in the repository’s packs are copied as they are, and the delta search only covers blobs that are not already stored as a delta, as Git does when serving. Like Git, pack.depth = 0 only disables new deltas: existing on-disk deltas are still sent.

§Parameters
  • cfg — repository config, or None for Git’s defaults.
  • thin — build a thin pack; pass true only when the client negotiated thin-pack and holds objects (sent haves), since a thin pack against nothing gains nothing.
  • use_ofs_delta — whether the client negotiated ofs-delta.
Source

pub fn for_local_push(cfg: Option<&ConfigSet>) -> Self

Production pack settings for an incremental in-process local push.

Uses a thin pack when the remote already has objects to delta against. Initial pushes into an empty bare repo should use Self::for_local_copy.

Trait Implementations§

Source§

impl Clone for PackBuildOptions

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 Copy for PackBuildOptions

Source§

impl Debug for PackBuildOptions

Source§

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

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

impl Default for PackBuildOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<PackBuildOptions> for PackObjectsOptions

Source§

fn from(build: PackBuildOptions) -> Self

Converts to this type from the input type.

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, 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.