pub struct Store { /* private fields */ }
Expand description
A database for reading and writing objects to disk, one file per object.
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 Id
s 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
loose::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.
pub fn verify_integrity(
&self,
progress: impl Progress,
should_interrupt: &AtomicBool
) -> Result<Statistics, Error>
pub fn verify_integrity(
&self,
progress: impl Progress,
should_interrupt: &AtomicBool
) -> Result<Statistics, Error>
Check all loose objects for their integrity checking their hash matches the actual data and by decoding them fully.
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
.
The object_hash
determines which hash to use when writing, finding or iterating objects.
Return the kind of hash we would iterate and write.
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.
Auto Trait Implementations
impl RefUnwindSafe for Store
impl UnwindSafe for Store
Blanket Implementations
Mutably borrows from an owned value. Read more