Type Alias gix_pack::find::Error

source ·
pub type Error = Box<dyn Error + Send + Sync + 'static>;
Expand description

The error returned by methods of the Find trait.

Aliased Type§

struct Error(/* private fields */);

Trait Implementations§

source§

impl<T: DecodeEntry + ?Sized> DecodeEntry for Box<T>

source§

fn put( &mut self, pack_id: u32, offset: u64, data: &[u8], kind: Kind, compressed_size: usize )

Store a fully decoded object at offset of kind with compressed_size and data in the cache. Read more
source§

fn get( &mut self, pack_id: u32, offset: u64, out: &mut Vec<u8> ) -> Option<(Kind, usize)>

Attempt to fetch the object at offset and store its decoded bytes in out, as previously stored with DecodeEntry::put(), and return its (object kind, decompressed_size)
1.0.0 · source§

impl<T, A> Deref for Box<T, A>where A: Allocator, T: ?Sized,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T> Find for Box<T>where T: Find,

source§

fn contains(&self, id: &oid) -> bool

Returns true if the object exists in the database.
source§

fn try_find_cached<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, pack_cache: &mut dyn DecodeEntry ) -> Result<Option<(Data<'a>, Option<Location>)>, Error>

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
source§

fn location_by_oid(&self, id: &oid, buf: &mut Vec<u8>) -> Option<Location>

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
source§

fn pack_offsets_and_oid(&self, pack_id: u32) -> Option<Vec<(Offset, ObjectId)>>

Obtain a vector of all offsets, in index order, along with their object id.
source§

fn entry_by_location(&self, location: &Location) -> Option<Entry>

Return the find::Entry for location if it is backed by a pack. Read more
source§

fn try_find<'a>( &self, id: &oid, buffer: &'a mut Vec<u8> ) -> Result<Option<(Data<'a>, Option<Location>)>, Error>

Find an object matching id in the database while placing its raw, decoded 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
source§

impl<T: Object + ?Sized> Object for Box<T>

source§

fn put(&mut self, id: ObjectId, kind: Kind, data: &[u8])

Put the object going by id of kind with data into the cache.
source§

fn get(&mut self, id: &ObjectId, out: &mut Vec<u8>) -> Option<Kind>

Try to retrieve the object named id and place its data into out if available and return Some(kind) if found.