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

A single commit-graph file.

All operations on a File are local to that graph file. Since a commit graph can span multiple files, all interesting graph operations belong on Graph.

Implementations

Access

The number of base graphs that this file depends on.

Returns the commit data for the commit located at the given lexigraphical position.

pos must range from 0 to self.num_commits().

Panics

Panics if pos is out of bounds.

The kind of hash used in this File.

Note that it is always conforming to the hash used in the owning repository.

Returns an object id at the given index in our list of (sorted) hashes. The position ranges from 0 to self.num_commits()

Return an iterator over all object hashes stored in the base graph.

return an iterator over all commits in this file.

Return an iterator over all object hashes stored in this file.

Translate the given object hash to its position within this file, if present.

Returns the number of commits in this graph file.

The maximum valid file::Position that can be used with this file is one less than num_commits().

Returns the path to this file.

Try to parse the commit graph file at path.

Verification

Returns the trailing checksum over the entire content of this file.

Traverse all commits stored in this file and call processor(commit) -> Result<(), Error> on it.

If the processor fails, the iteration will be stopped and the entire call results in the respective error.

Assure the checksum matches the actual checksum over all content of this file, excluding the trailing checksum itself.

Return the actual checksum on success or (actual checksum, expected checksum) if there is a mismatch.

Trait Implementations

Formats the value using the given formatter. Read more

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