pub struct File { /* private fields */ }
Expand description

A representation of an index file for multiple packs at the same time, typically stored in a file named ‘multi-pack-index’.

Implementations

Create a new multi-index file for writing to out from the pack index files at index_paths.

Progress is sent to progress and interruptions checked via should_interrupt.

Access methods

Returns the verion of the multi-index file.

Returns the path from which the multi-index file was loaded.

Note that it might have changed in the mean time, or might have been removed as well.

Returns the amount of indices stored in this multi-index file. It’s the same as File::index_names().len(), and returned as one past the highest known index.

Returns the total amount of objects available for lookup, and returned as one past the highest known entry index

Returns the kind of hash function used for object ids available in this index.

Returns the checksum over the entire content of the file (excluding the checksum itself).

It can be used to validate it didn’t change after creation.

Return all names of index files (*.idx) whose objects we contain.

The corresponding pack can be found by replacing the .idx extension with .pack.

Return the object id at the given index, which ranges from 0 to File::num_objects().

Given a prefix, find an object that matches it uniquely within this index and return Some(Ok(entry_index)). If there is more than one object matching the object Some(Err(()) is returned.

Finally, if no object matches the index, the return value is None.

Find the index ranging from 0 to File::num_objects() that belongs to data associated with id, or None if it wasn’t found.

Use this index for finding additional information via File::pack_id_and_pack_offset_at_index().

Given the index ranging from 0 to File::num_objects(), return the pack index and its absolute offset into the pack.

The pack-index refers to an entry in the index_names list, from which the pack can be derived.

Return an iterator over all entries within this file.

Validate that our checksum() matches the actual contents of this index file, and return it if it does.

Similar to verify_integrity() but without any deep inspection of objects.

Instead we only validate the contents of the multi-index itself.

Similar to crate::Bundle::verify_integrity() but checks all contained indices and their packs.

Note that it’s considered a failure if an index doesn’t have a corresponding pack.

Initialization

Open the multi-index file at the given path.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.