superseded by git_odb::Store
Expand description
A static object database with tiered lookup in packs and loose objects. This is a typical git database as used in git repositories, sans ‘alternates’. Note that this ODB won’t detect changes on disk and will eagerly map all relevant files. Multipack indices are not supported either.
Fields
loose: Store
superseded by git_odb::Store
A loose object database into which new objects are written
bundles: Vec<Bundle>
superseded by git_odb::Store
All packs in the objects/packs
directory
Implementations
sourceimpl Store
impl Store
sourcepub fn try_find<'a>(
&self,
id: impl AsRef<oid>,
buffer: &'a mut Vec<u8>,
pack_cache: &mut impl DecodeEntry
) -> Result<Option<Data<'a>>, Error>
pub fn try_find<'a>(
&self,
id: impl AsRef<oid>,
buffer: &'a mut Vec<u8>,
pack_cache: &mut impl DecodeEntry
) -> Result<Option<Data<'a>>, Error>
Find an object as identified by ObjectId
and store its data in full in the provided buffer
.
This will search the object in all contained object databases.
Use a pack_cache
to accelerate pack access by reducing the amount of work duplication, or pack::cache::Never
to disable any caching.
sourceimpl Store
impl Store
Instantiation
sourcepub fn at(
objects_directory: impl Into<PathBuf>,
pack_id_offset: u32
) -> Result<Store, Error>
pub fn at(
objects_directory: impl Into<PathBuf>,
pack_id_offset: u32
) -> Result<Store, Error>
Returns a compound database as initialized from the given git objects_directory
, commonly .git/objects
.
Only loose and packed objects will be considered. See the linked Db for a database with support for git alternates, i.e. linking to other repositories.
pack_id_offset
is used to allow multiple compound databases to be used for lookups without their pack-ids clashing.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnwindSafe for Store
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more