[−][src]Struct transact::state::merkle::MerkleRadixTree
Merkle Database
Methods
impl MerkleRadixTree
[src]
pub fn new(
db: Box<dyn Database>,
merkle_root: Option<&str>
) -> Result<Self, StateDatabaseError>
[src]
db: Box<dyn Database>,
merkle_root: Option<&str>
) -> Result<Self, StateDatabaseError>
Constructs a new MerkleRadixTree, backed by a given Database
An optional starting merkle root may be provided.
pub fn prune(
db: &dyn Database,
merkle_root: &str
) -> Result<Vec<String>, StateDatabaseError>
[src]
db: &dyn Database,
merkle_root: &str
) -> Result<Vec<String>, StateDatabaseError>
Prunes nodes that are no longer needed under a given state root Returns a list of addresses that were deleted
pub fn get_merkle_root(&self) -> String
[src]
Returns the current merkle root for this MerkleRadixTree
pub fn set_merkle_root<S: Into<String>>(
&mut self,
merkle_root: S
) -> Result<(), StateDatabaseError>
[src]
&mut self,
merkle_root: S
) -> Result<(), StateDatabaseError>
Sets the current merkle root for this MerkleRadixTree
pub fn update(
&self,
state_changes: &[StateChange],
is_virtual: bool
) -> Result<String, StateDatabaseError>
[src]
&self,
state_changes: &[StateChange],
is_virtual: bool
) -> Result<String, StateDatabaseError>
Updates the tree with multiple changes. Applies both set and deletes, as given.
If the flag is_virtual
is set, the values are not written to the
underlying database.
Returns a Result with the new root hash.
pub fn get_value(
&self,
address: &str
) -> Result<Option<Vec<u8>>, StateDatabaseError>
[src]
&self,
address: &str
) -> Result<Option<Vec<u8>>, StateDatabaseError>
pub fn contains(&self, address: &str) -> Result<bool, StateDatabaseError>
[src]
pub fn leaves(
&self,
prefix: Option<&str>
) -> Result<Box<dyn Iterator<Item = Result<(String, Vec<u8>), StateDatabaseError>>>, StateDatabaseError>
[src]
&self,
prefix: Option<&str>
) -> Result<Box<dyn Iterator<Item = Result<(String, Vec<u8>), StateDatabaseError>>>, StateDatabaseError>
Trait Implementations
impl Clone for MerkleRadixTree
[src]
fn clone(&self) -> MerkleRadixTree
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl Send for MerkleRadixTree
impl Unpin for MerkleRadixTree
impl Sync for MerkleRadixTree
impl !UnwindSafe for MerkleRadixTree
impl !RefUnwindSafe for MerkleRadixTree
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Send + Sync + Clone,
T: 'a + Send + Sync + Clone,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
impl<T> Same<T> for T
type Output = T
Should always be Self