Struct git_pack::Bundle[][src]

pub struct Bundle {
    pub pack: File,
    pub index: File,
}
Expand description

A bundle of pack data and the corresponding pack index

Fields

pack: File

The pack file corresponding to index

index: File

The index file corresponding to pack

Implementations

Initialization

Create a Bundle from path, which is either a pack file (*.pack) or an index file (*.idx).

The corresponding complementary file is expected to be present. Also available via Bundle::try_from().

Find an object with the given ObjectId and place its data into out.

cache is used to accelerate the lookup.

Note that ref deltas are automatically resolved within this pack only, which makes this implementation unusable for thin packs, which by now are expected to be resolved already.

Special-use function to get an object given an index previously returned from internal_find_pack_index.

Panics

If index is out of bounds.

Given a pack data stream, write it along with a generated index into the directory if Some or discard all output if None.

In the latter case, the functionality provided here is more akind of pack data stream validation.

  • progress provides detailed progress information which can be discarded with [git_features::progress::Discard].
  • should_interrupt is checked regularly and when true, the whole operation will stop.
  • thin_pack_base_object_lookup_fn If set, we expect to see a thin-pack with objects that reference their base object by object id which is expected to exist in the object database the bundle is contained within. options further configure how the task is performed.
Note
  • the resulting pack may be empty, that is, contains zero objects in some situations. This is a valid reply by a server and should be accounted for.
    • Empty packs always have the same name and not handling this case will result in at most one superfluous pack.

Equivalent to write_to_directory() but offloads reading of the pack into its own thread, hence the Send + 'static' bounds.

Note

As it sends portions of the input to a thread it requires the ’static lifetime for the interrupt flags. This can only be satisfied by a static AtomicBool which is only suitable for programs that only run one of these operations at a time or don’t mind that all of them abort when the flag is set.

Similar to crate::index::File::verify_integrity() but more convenient to call as the presence of the pack file is a given.

Trait Implementations

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.