Struct git_odb::loose::Store[][src]

pub struct Store {
    pub path: PathBuf,
}
Expand description

A database for reading and writing objects to disk, one file per object.

Fields

path: PathBuf

The directory in which objects are stored, containing 256 folders representing the hashes first byte.

Implementations

Object lookup

Returns true if the given id is contained in our repository.

Return the object identified by the given ObjectId if present in this database, writing its raw data into the given out buffer.

Returns Err if there was an error locating or reading the object. Returns Ok<None> if there was no such object.

Iteration and traversal

Return an iterator over all objects contained in the database.

The Ids returned by the iterator can typically be used in the locate(…) method. Note that the result is not sorted or stable, thus ordering can change between runs.

Notes

Iter is used instead of impl Iterator<…> to allow using this iterator in struct fields, as is currently needed if iterators need to be implemented by hand in the absence of generators.

Initialization

Initialize the Db with the objects_directory containing the hexadecimal first byte subdirectories, which in turn contain all loose objects.

In a git repository, this would be .git/objects.

Trait Implementations

Write the given buffer in from to disk in one syscall at best.

This will cost at least 4 IO operations.

Write the given stream in from to disk with at least one syscall.

This will cost at least 4 IO operations.

The error type used for all trait methods. Read more

Write objects using the given kind of hash into the database, returning id to reference it in subsequent reads. Read more

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.