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.

Return a shared reference to the contained store.

Return an owned store with shared ownership.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Executes the destructor for this type. Read more

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

The error type used for all trait methods. Read more

As write, but takes an input stream. This is commonly used for writing blobs directly without reading them to memory first. Read more

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

As write, but takes an object kind along with its encoded bytes.

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

Like try_find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error.

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired object type. Read more

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired object type. Read more

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired object type. Read more

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired object type. Read more

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired iterator type. Read more

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired iterator type. Read more

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired iterator type. 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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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.