pub trait Reader {
// Required methods
fn read_commit(&self, oid: &Oid) -> Result<Option<Vec<u8>>, ReadCommit>;
fn read_blob(
&self,
commit: &Oid,
path: &Path,
) -> Result<Option<Blob>, ReadBlob>;
}Expand description
Git object reader, generally a Git repository, or its corresponding Object Database (ODB).
Required Methods§
Sourcefn read_commit(&self, oid: &Oid) -> Result<Option<Vec<u8>>, ReadCommit>
fn read_commit(&self, oid: &Oid) -> Result<Option<Vec<u8>>, ReadCommit>
Read the raw bytes of a commit object identified by oid.
Returns None if no such object exists.
§Errors
error::ReadCommit::IncorrectObject: the object identified by theOidwas found, but was not a commit.error::ReadCommit::Other: failed to read the Git commit.
Sourcefn read_blob(&self, commit: &Oid, path: &Path) -> Result<Option<Blob>, ReadBlob>
fn read_blob(&self, commit: &Oid, path: &Path) -> Result<Option<Blob>, ReadBlob>
Read the raw bytes of the blob at path within the tree of commit.
Returns None if the path does not exist in that tree.
§Errors
error::ReadBlob::CommitNotFound: failed to find the commit identified by theOid.error::ReadBlob::IncorrectObject: the object identified by theOidwas found, but was not a commit.error::ReadBlob::Other: failed to read the Git blob.