Trait gix::worktree::object::Find

source ·
pub trait Find {
    // Required method
    fn try_find<'a>(
        &self,
        id: &oid,
        buffer: &'a mut Vec<u8>,
    ) -> Result<Option<Data<'a>>, Box<dyn Error + Send + Sync>>;
}
Available on crate feature excludes only.
Expand description

Find an object in the object store.

§Notes

Find effectively needs generic associated types to allow a trait for the returned object type. Until then, we will have to make due with explicit types and give them the potentially added features we want.

Required Methods§

source

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

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

Returns Some object if it was present in the database, or the error that occurred during lookup or object retrieval.

Implementations on Foreign Types§

source§

impl<S> Find for Handle<S>
where S: Deref<Target = Store> + Clone, Handle<S>: Find,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

Implementors§