docs: add docs for Errors

This commit is contained in:
Magamedrasul Ibragimov 2023-04-25 17:40:07 +04:00
parent b2d53e6723
commit 108e791d78
2 changed files with 4 additions and 1 deletions

View File

@ -23,6 +23,6 @@ pub trait Database {
/// Puts the value to the db by the key
fn put(&mut self, key: DBKey, value: Value) -> PmtreeResult<()>;
/// Batc
/// Puts the leaves batch to the db
fn put_batch(&mut self, subtree: HashMap<DBKey, Value>) -> PmtreeResult<()>;
}

View File

@ -22,6 +22,7 @@ pub type DBKey = [u8; 8];
/// Denotes values in a database
pub type Value = Vec<u8>;
/// Denotes pmtree Merkle tree errors
#[derive(Debug)]
pub enum TreeErrorKind {
MerkleTreeIsFull,
@ -30,6 +31,7 @@ pub enum TreeErrorKind {
CustomError(String),
}
/// Denotes pmtree database errors
#[derive(Debug)]
pub enum DatabaseErrorKind {
CannotLoadDatabase,
@ -37,6 +39,7 @@ pub enum DatabaseErrorKind {
CustomError(String),
}
/// Denotes pmtree errors
#[derive(Debug)]
pub enum PmtreeErrorKind {
/// Error in database