pub struct Change {
pub adds: HashMap<H256, Vec<u8>>,
pub removes: HashSet<H256>,
}
Expand description
Change for a merkle trie operation.
Fields§
§adds: HashMap<H256, Vec<u8>>
Additions to the database.
removes: HashSet<H256>
Removals to the database.
Implementations§
Source§impl Change
impl Change
Sourcepub fn add_node<'a, 'b, 'c>(&'a mut self, node: &'c MerkleNode<'b>)
pub fn add_node<'a, 'b, 'c>(&'a mut self, node: &'c MerkleNode<'b>)
Change to add a new node.
Sourcepub fn add_value<'a, 'b, 'c>(
&'a mut self,
node: &'c MerkleNode<'b>,
) -> MerkleValue<'b>
pub fn add_value<'a, 'b, 'c>( &'a mut self, node: &'c MerkleNode<'b>, ) -> MerkleValue<'b>
Change to add a new node, and return the value added.
Sourcepub fn remove_raw(&mut self, key: H256)
pub fn remove_raw(&mut self, key: H256)
Change to remove a raw key.
Sourcepub fn remove_node<'a, 'b, 'c>(&'a mut self, node: &'c MerkleNode<'b>) -> bool
pub fn remove_node<'a, 'b, 'c>(&'a mut self, node: &'c MerkleNode<'b>) -> bool
Change to remove a node. Return whether there’s any node being removed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnwindSafe for Change
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