pub struct Trie<D: DatabaseGuard> {
pub database: D,
/* private fields */
}Fields§
§database: DImplementations§
Source§impl<D: DatabaseGuard> Trie<D>
impl<D: DatabaseGuard> Trie<D>
pub fn empty(database: D) -> Self
pub fn existing(database: D, root: H256) -> Self
pub fn iter(&self) -> MerkleIterator<'_, D> ⓘ
pub fn root(&self) -> H256
pub fn is_empty(&self) -> bool
pub fn get<K: Encodable, V: Decodable>(&self, key: &K) -> Option<V>
pub fn insert<K: Encodable, V: Encodable>(&mut self, key: K, value: V)
pub fn remove<K: Encodable>(&mut self, key: &K)
pub fn build(database: D, map: &HashMap<Vec<u8>, Vec<u8>>) -> Self
pub fn get_raw<'a, 'b>(&'a self, key: &'b [u8]) -> Option<Vec<u8>>
pub fn insert_raw(&mut self, key: Vec<u8>, value: Vec<u8>)
pub fn remove_raw<'a, 'b: 'a>(&'a mut self, key: &'b [u8])
Trait Implementations§
Auto Trait Implementations§
impl<D> Freeze for Trie<D>where
D: Freeze,
impl<D> RefUnwindSafe for Trie<D>where
D: RefUnwindSafe,
impl<D> Send for Trie<D>where
D: Send,
impl<D> Sync for Trie<D>where
D: Sync,
impl<D> Unpin for Trie<D>where
D: Unpin,
impl<D> UnwindSafe for Trie<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more