use crate::domain::hash::Hash;
use crate::domain::object::Object;
use crate::error::VctrlError;
pub trait ObjectStore {
fn put(&mut self, hash: &Hash, obj: &Object) -> Result<(), VctrlError>;
fn get(&self, hash: &Hash) -> Result<Option<Object>, VctrlError>;
fn exists(&self, hash: &Hash) -> Result<bool, VctrlError>;
}
pub trait RefStore {
fn set_ref(&mut self, name: &str, hash: &Hash) -> Result<(), VctrlError>;
fn get_ref(&self, name: &str) -> Result<Option<Hash>, VctrlError>;
fn delete_ref(&mut self, name: &str) -> Result<(), VctrlError>;
fn set_head(&mut self, target: &str) -> Result<(), VctrlError>;
fn head(&self) -> Result<Option<Hash>, VctrlError>;
fn head_ref_name(&self) -> Result<Option<String>, VctrlError>;
}