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
|
/// Puts the value to the db by the key
|
||||||
fn put(&mut self, key: DBKey, value: Value) -> PmtreeResult<()>;
|
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<()>;
|
fn put_batch(&mut self, subtree: HashMap<DBKey, Value>) -> PmtreeResult<()>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ pub type DBKey = [u8; 8];
|
||||||
/// Denotes values in a database
|
/// Denotes values in a database
|
||||||
pub type Value = Vec<u8>;
|
pub type Value = Vec<u8>;
|
||||||
|
|
||||||
|
/// Denotes pmtree Merkle tree errors
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum TreeErrorKind {
|
pub enum TreeErrorKind {
|
||||||
MerkleTreeIsFull,
|
MerkleTreeIsFull,
|
||||||
|
@ -30,6 +31,7 @@ pub enum TreeErrorKind {
|
||||||
CustomError(String),
|
CustomError(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Denotes pmtree database errors
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum DatabaseErrorKind {
|
pub enum DatabaseErrorKind {
|
||||||
CannotLoadDatabase,
|
CannotLoadDatabase,
|
||||||
|
@ -37,6 +39,7 @@ pub enum DatabaseErrorKind {
|
||||||
CustomError(String),
|
CustomError(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Denotes pmtree errors
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum PmtreeErrorKind {
|
pub enum PmtreeErrorKind {
|
||||||
/// Error in database
|
/// Error in database
|
||||||
|
|
Loading…
Reference in New Issue