diff --git a/src/database.rs b/src/database.rs index 833eeff..1aefb45 100644 --- a/src/database.rs +++ b/src/database.rs @@ -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>; + /// 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<()>; } diff --git a/src/hasher.rs b/src/hasher.rs index 2cc08cb..4368e91 100644 --- a/src/hasher.rs +++ b/src/hasher.rs @@ -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; }