updated FatDB description
This commit is contained in:
parent
7904464d24
commit
06cf2a3f41
@ -19,9 +19,10 @@ use sha3::Hashable;
|
|||||||
use hashdb::HashDB;
|
use hashdb::HashDB;
|
||||||
use super::{TrieDB, Trie, TrieDBIterator, TrieError};
|
use super::{TrieDB, Trie, TrieDBIterator, TrieError};
|
||||||
|
|
||||||
/// A mutable `Trie` implementation which hashes keys and uses a generic `HashDB` backing database.
|
/// A `Trie` implementation which hashes keys and uses a generic `HashDB` backing database.
|
||||||
|
/// Additionaly it stores inserted hash-key mappings for later retrieval.
|
||||||
///
|
///
|
||||||
/// Use it as a `Trie` or `TrieMut` trait object. You can use `raw()` to get the backing `TrieDB` object.
|
/// Use it as a `Trie` or `TrieMut` trait object.
|
||||||
pub struct FatDB<'db> {
|
pub struct FatDB<'db> {
|
||||||
raw: TrieDB<'db>,
|
raw: TrieDB<'db>,
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,9 @@ use hashdb::HashDB;
|
|||||||
use super::{TrieDBMut, Trie, TrieMut, TrieError};
|
use super::{TrieDBMut, Trie, TrieMut, TrieError};
|
||||||
|
|
||||||
/// A mutable `Trie` implementation which hashes keys and uses a generic `HashDB` backing database.
|
/// A mutable `Trie` implementation which hashes keys and uses a generic `HashDB` backing database.
|
||||||
|
/// Additionaly it stores inserted hash-key mappings for later retrieval.
|
||||||
///
|
///
|
||||||
/// Use it as a `Trie` or `TrieMut` trait object. You can use `raw()` to get the backing `TrieDBMut` object.
|
/// Use it as a `Trie` or `TrieMut` trait object.
|
||||||
pub struct FatDBMut<'db> {
|
pub struct FatDBMut<'db> {
|
||||||
raw: TrieDBMut<'db>,
|
raw: TrieDBMut<'db>,
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ impl TrieFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create new immutable instance of Trie.
|
/// Create new immutable instance of Trie.
|
||||||
pub fn create<'db>(&self, db: &'db HashDB, root: &'db H256) -> Result<Box<Trie + 'db>, TrieError> {
|
pub fn readonly<'db>(&self, db: &'db HashDB, root: &'db H256) -> Result<Box<Trie + 'db>, TrieError> {
|
||||||
match self.spec {
|
match self.spec {
|
||||||
TrieSpec::Generic => Ok(Box::new(try!(TrieDB::new(db, root)))),
|
TrieSpec::Generic => Ok(Box::new(try!(TrieDB::new(db, root)))),
|
||||||
TrieSpec::Secure => Ok(Box::new(try!(SecTrieDB::new(db, root)))),
|
TrieSpec::Secure => Ok(Box::new(try!(SecTrieDB::new(db, root)))),
|
||||||
@ -104,7 +104,7 @@ impl TrieFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create new mutable instance of Trie.
|
/// Create new mutable instance of Trie.
|
||||||
pub fn create_mut<'db>(&self, db: &'db mut HashDB, root: &'db mut H256) -> Box<TrieMut + 'db> {
|
pub fn create<'db>(&self, db: &'db mut HashDB, root: &'db mut H256) -> Box<TrieMut + 'db> {
|
||||||
match self.spec {
|
match self.spec {
|
||||||
TrieSpec::Generic => Box::new(TrieDBMut::new(db, root)),
|
TrieSpec::Generic => Box::new(TrieDBMut::new(db, root)),
|
||||||
TrieSpec::Secure => Box::new(SecTrieDBMut::new(db, root)),
|
TrieSpec::Secure => Box::new(SecTrieDBMut::new(db, root)),
|
||||||
|
Loading…
Reference in New Issue
Block a user