pub struct PackBuilder { /* private fields */ }Expand description
Pack builder for creating packfiles.
Implementations§
Source§impl PackBuilder
impl PackBuilder
Sourcepub fn new(compression: CompressionConfig) -> PackBuilder
pub fn new(compression: CompressionConfig) -> PackBuilder
Create a new pack builder.
Sourcepub fn for_repack(
compression: CompressionConfig,
delta_window: usize,
) -> PackBuilder
pub fn for_repack( compression: CompressionConfig, delta_window: usize, ) -> PackBuilder
Create a pack builder tuned for repacking an existing object corpus.
delta_window controls how many recently sorted objects are considered
as delta bases. A zero-sized window disables delta-base selection.
Sourcepub fn add(&mut self, hash: ContentHash, obj_type: ObjectType, data: Vec<u8>)
pub fn add(&mut self, hash: ContentHash, obj_type: ObjectType, data: Vec<u8>)
Add an object to the pack.
pub fn add_id(&mut self, id: PackObjectId, obj_type: ObjectType, data: Vec<u8>)
Sourcepub fn add_with_path(
&mut self,
hash: ContentHash,
obj_type: ObjectType,
data: Vec<u8>,
path: Option<String>,
)
pub fn add_with_path( &mut self, hash: ContentHash, obj_type: ObjectType, data: Vec<u8>, path: Option<String>, )
Add an object with a path hint for better delta grouping.
Objects sharing the same path (e.g. successive versions of src/main.rs)
will be sorted together for delta encoding, producing much better
compression ratios than size-only ordering.
pub fn add_with_path_id( &mut self, id: PackObjectId, obj_type: ObjectType, data: Vec<u8>, path: Option<String>, )
Sourcepub fn logical_id(&self) -> PackLogicalId
pub fn logical_id(&self) -> PackLogicalId
Compute the logical identity of the objects currently in this builder.
Path hints, compression, output order, and later delta-base selection do not participate in this root-spool-scoped identity.
Auto Trait Implementations§
impl Freeze for PackBuilder
impl RefUnwindSafe for PackBuilder
impl Send for PackBuilder
impl Sync for PackBuilder
impl Unpin for PackBuilder
impl UnsafeUnpin for PackBuilder
impl UnwindSafe for PackBuilder
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
Mutably borrows from an owned value. Read more