mirror of https://github.com/vacp2p/pmtree.git
style: add new lines to hasher & database modules
This commit is contained in:
parent
e650af8ee4
commit
e400803cbe
|
@ -4,12 +4,16 @@ use crate::*;
|
|||
pub trait Database {
|
||||
/// Creates new instance of db
|
||||
fn new(dbpath: &str) -> Self;
|
||||
|
||||
/// Loades existing db (existence check required)
|
||||
fn load(dbpath: &str) -> Self;
|
||||
|
||||
/// Returns value from db by the key
|
||||
fn get(&self, key: DBKey) -> Result<Option<Value>>;
|
||||
|
||||
/// Puts the value to the db by the key
|
||||
fn put(&mut self, key: DBKey, value: Value) -> Result<()>;
|
||||
|
||||
/// Deletes the key from db
|
||||
fn delete(&mut self, key: DBKey) -> Result<()>;
|
||||
}
|
||||
|
|
|
@ -7,8 +7,10 @@ pub trait Hasher {
|
|||
|
||||
/// Creates new hash-function instance
|
||||
fn new() -> Self;
|
||||
|
||||
/// Outputs the default leaf (Fr::default())
|
||||
fn default_leaf() -> Self::Fr;
|
||||
|
||||
/// Calculates hash-function
|
||||
fn hash(input: &[Self::Fr]) -> Self::Fr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue