pub struct PackBuilder { /* private fields */ }Expand description
Pack builder for creating packfiles.
Implementations§
Source§impl PackBuilder
impl PackBuilder
Sourcepub fn new(compression: CompressionConfig) -> Self
pub fn new(compression: CompressionConfig) -> Self
Create a new pack builder.
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>, )
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