Trait FindExt

Source
pub trait FindExt: Find {
    // Provided methods
    fn find<'a>(
        &self,
        id: impl AsRef<oid>,
        buffer: &'a mut Vec<u8>,
    ) -> Result<Data<'a>, Error<Self::Error>> { ... }
    fn find_commit<'a>(
        &self,
        id: impl AsRef<oid>,
        buffer: &'a mut Vec<u8>,
    ) -> Result<CommitRef<'a>, Error<Self::Error>> { ... }
    fn find_tree<'a>(
        &self,
        id: impl AsRef<oid>,
        buffer: &'a mut Vec<u8>,
    ) -> Result<TreeRef<'a>, Error<Self::Error>> { ... }
    fn find_tag<'a>(
        &self,
        id: impl AsRef<oid>,
        buffer: &'a mut Vec<u8>,
    ) -> Result<TagRef<'a>, Error<Self::Error>> { ... }
    fn find_blob<'a>(
        &self,
        id: impl AsRef<oid>,
        buffer: &'a mut Vec<u8>,
    ) -> Result<BlobRef<'a>, Error<Self::Error>> { ... }
    fn find_commit_iter<'a>(
        &self,
        id: impl AsRef<oid>,
        buffer: &'a mut Vec<u8>,
    ) -> Result<CommitRefIter<'a>, Error<Self::Error>> { ... }
    fn find_tree_iter<'a>(
        &self,
        id: impl AsRef<oid>,
        buffer: &'a mut Vec<u8>,
    ) -> Result<TreeRefIter<'a>, Error<Self::Error>> { ... }
    fn find_tag_iter<'a>(
        &self,
        id: impl AsRef<oid>,
        buffer: &'a mut Vec<u8>,
    ) -> Result<TagRefIter<'a>, Error<Self::Error>> { ... }
}
Expand description

An extension trait with convenience functions.

Provided Methods§

Source

fn find<'a>( &self, id: impl AsRef<oid>, buffer: &'a mut Vec<u8>, ) -> Result<Data<'a>, Error<Self::Error>>

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

Source

fn find_commit<'a>( &self, id: impl AsRef<oid>, buffer: &'a mut Vec<u8>, ) -> Result<CommitRef<'a>, Error<Self::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.

Source

fn find_tree<'a>( &self, id: impl AsRef<oid>, buffer: &'a mut Vec<u8>, ) -> Result<TreeRef<'a>, Error<Self::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.

Source

fn find_tag<'a>( &self, id: impl AsRef<oid>, buffer: &'a mut Vec<u8>, ) -> Result<TagRef<'a>, Error<Self::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.

Source

fn find_blob<'a>( &self, id: impl AsRef<oid>, buffer: &'a mut Vec<u8>, ) -> Result<BlobRef<'a>, Error<Self::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.

Source

fn find_commit_iter<'a>( &self, id: impl AsRef<oid>, buffer: &'a mut Vec<u8>, ) -> Result<CommitRefIter<'a>, Error<Self::Error>>

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

Source

fn find_tree_iter<'a>( &self, id: impl AsRef<oid>, buffer: &'a mut Vec<u8>, ) -> Result<TreeRefIter<'a>, Error<Self::Error>>

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

Source

fn find_tag_iter<'a>( &self, id: impl AsRef<oid>, buffer: &'a mut Vec<u8>, ) -> Result<TagRefIter<'a>, Error<Self::Error>>

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Find> FindExt for T