mirror of https://github.com/vacp2p/pmtree.git
docs: add docs for Errors
This commit is contained in:
parent
b2d53e6723
commit
108e791d78
|
@ -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<()>;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue