pub struct Handle<S> where
S: Deref<Target = Store> + Clone, {
pub refresh_mode: RefreshMode,
/* private fields */
}
Expand description
This effectively acts like a handle but exists to be usable from the actual crate::Handle
implementation which adds caches on top.
Each store is quickly cloned and contains thread-local state for shared packs.
Fields
refresh_mode: RefreshMode
Defines what happens when there is no more indices to load.
Implementations
Return an iterator over all objects, first the ones in all packs of all linked databases (via alternates), followed by all loose objects.
Call once if pack ids are stored and later used for lookup, meaning they should always remain mapped and not be unloaded even if they disappear from disk. This must be called if there is a chance that git maintenance is happening while a pack is created.
Set the handle to never cause ODB refreshes if an object could not be found.
The latter is the default, as typically all objects referenced in a git repository are contained in the local clone. More recently, however, this doesn’t always have to be the case due to sparse checkouts and other ways to only have a limited amount of objects available locally.
Return the current refresh mode.
Trait Implementations
The error returned by try_find()
Returns true if the object exists in the database.
Like Find::try_find()
, but with support for controlling the pack cache.
A pack_cache
can be used to speed up subsequent lookups, set it to crate::cache::Never
if the
workload isn’t suitable for caching. Read more
Find the packs location where an object with id
can be found in the database, or None
if there is no pack
holding the object. Read more
Obtain a vector of all offsets, in index order, along with their object id.
Return the find::Entry
for location
if it is backed by a pack. Read more
Find an object matching id
in the database while placing its raw, undecoded data into buffer
.
A pack_cache
can be used to speed up subsequent lookups, set it to crate::cache::Never
if the
workload isn’t suitable for caching. Read more
Auto Trait Implementations
impl<S> !RefUnwindSafe for Handle<S>
impl<S> UnwindSafe for Handle<S> where
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Like try_find(…)
, but flattens the Result<Option<_>>
into a single Result
making a non-existing object an error.