Crate git_odb[][src]

Git stores all of its data as Objects, which are nothing more than data along with a hash over all data. Thus it’s an object store indexed by data with inherent deduplication: the same data will have the same hash, and thus occupy the same space within the database.

There are various flavours of object databases, all of which supporting iteration, reading and possibly writing.

  • loose::Db
    • A database storing one object per file, named by its hash, using zlib compression.
    • O(1) reads and writes, bound by IO operations per second
  • pack::Bundle
    • A database storing multiple objects within an indexed pack file, reaching compression ratios of 60 to 1 or more.
    • Slow writes and fast reads
  • compound::Db
    • A database using a loose::Db for writes and multiple pack::Bundles for object reading. It can also refer to multiple additional compound::Db instances using git-alternates.
    • This is the database closely resembling the object database in a git repository, and probably what most people would want to use.
  • linked::Db
    • A database containing various compound::Dbs as gathered from alternates files.

Re-exports

pub use find::Find;
pub use write::Write;

Modules

alternate

A file with directories of other git object databases to use when reading objects.

compound

An object database delegating object access to multiple contained object databases with loose and packed objects.

data

Contains a borrowed Object bound to a buffer holding its decompressed data.

find
linked

An object database representing a list of compound databases commonly created using git alternates.

loose

An object database storing each object in a zlib compressed file with its hash in the path

pack

Handle packs and pack indices

write

Structs

Sink

An object database equivalent to /dev/null, dropping all objects stored into it.

Traits

FindExt

An extension trait with convenience functions.

Functions

sink

Create a new Sink with compression disabled.