libvctrl_handler 5.2.0

Fundamental contracts for building a version control system – no implementations, only traits and types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::io::Read;

use crate::errors::VctrlError;

pub trait PackWriter: Send + Sync {
    type ObjectId: Send + Sync;

    fn write_object(&mut self, id: &Self::ObjectId, data: &[u8]) -> Result<(), VctrlError>;
    fn finish(&mut self) -> Result<(), VctrlError>;
}

pub trait PackReader: Send + Sync {
    type ObjectId: Send + Sync;

    fn read_object(&self, id: &Self::ObjectId) -> Result<Box<dyn Read + Send + '_>, VctrlError>;
}