pub struct CatFileBatch { /* private fields */ }Expand description
A long-lived git cat-file --batch child bound to one repository.
Batch protocol (verified against git ≥ 2.30): write <oid>\n to
stdin; read <oid> <type> <size>\n, exactly <size> body bytes,
then one trailing \n. Unknown ids answer <oid> missing\n
(no body — the stream stays clean). Any OTHER read error leaves
the stream desynchronized: treat it as fatal for this batch.
Implementations§
Source§impl CatFileBatch
impl CatFileBatch
Sourcepub fn open(repo: &Path) -> Result<Self, BridgeError>
pub fn open(repo: &Path) -> Result<Self, BridgeError>
Spawn the child against repo (a .git/bare directory).
Sourcepub fn read(
&mut self,
id: &Sha1Id,
) -> Result<(GitObjKind, Vec<u8>), BridgeError>
pub fn read( &mut self, id: &Sha1Id, ) -> Result<(GitObjKind, Vec<u8>), BridgeError>
Read one object’s kind + body bytes.
Trait Implementations§
Source§impl Debug for CatFileBatch
impl Debug for CatFileBatch
Source§impl Drop for CatFileBatch
impl Drop for CatFileBatch
Source§impl GitSource for CatFileBatch
impl GitSource for CatFileBatch
fn read_git( &mut self, id: &Sha1Id, ) -> Result<(GitObjKind, Vec<u8>), BridgeError>
Auto Trait Implementations§
impl Freeze for CatFileBatch
impl RefUnwindSafe for CatFileBatch
impl Send for CatFileBatch
impl Sync for CatFileBatch
impl Unpin for CatFileBatch
impl UnsafeUnpin for CatFileBatch
impl UnwindSafe for CatFileBatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more