Type Alias gix::OdbHandle

source ·
pub type OdbHandle = Handle;
Expand description

A handle for finding objects in an object database, abstracting away caches for thread-local use.

Aliased Type§

struct OdbHandle { /* private fields */ }

Trait Implementations§

source§

impl<S> Deref for Cache<S>

§

type Target = S

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Cache<S> as Deref>::Target

Dereferences the value.
source§

impl<S> Find for Cache<S>where S: Find,

source§

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

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

fn try_find<'a>( &self, id: &oid, buffer: &'a mut Vec<u8, Global> ) -> Result<Option<Data<'a>>, Box<dyn Error + Send + Sync, Global>>

Find an object matching id in the database while placing its raw, possibly encoded data into buffer. Read more
source§

impl<S> Header for Cache<S>where S: Header,

source§

fn try_header( &self, id: &oid ) -> Result<Option<Header>, Box<dyn Error + Send + Sync, Global>>

Try to read the header of the object associated with id or return None if it could not be found.
source§

impl<S> Write for Cache<S>where S: Write,

source§

fn write_stream( &self, kind: Kind, size: u64, from: &mut dyn Read ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

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

fn write( &self, object: &dyn WriteTo ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

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

fn write_buf( &self, object: Kind, from: &[u8] ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

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