Struct cfx_storage::cow_node_ref::MaybeOwnedTrieNode
source · pub struct MaybeOwnedTrieNode<'a> { /* private fields */ }
Implementations§
source§impl<'a> MaybeOwnedTrieNode<'a>
impl<'a> MaybeOwnedTrieNode<'a>
pub fn take(x: Self) -> MaybeOwnedTrieNodeAsCowCallParam
source§impl<'a> MaybeOwnedTrieNode<'a>
impl<'a> MaybeOwnedTrieNode<'a>
pub unsafe fn owned_as_mut_unchecked(&mut self) -> &'a mut TrieNodeDeltaMpt
Methods from Deref<Target = TrieNodeDeltaMpt>§
pub fn get_compressed_path_size(&self) -> u16
pub fn value_clone(&self) -> MptValue<Box<[u8]>>
sourcepub unsafe fn copy_and_replace_fields(
&self,
new_value: Option<Option<Box<[u8]>>>,
new_path: Option<CompressedPathRaw>,
children_table: Option<ChildrenTableDeltaMpt>
) -> MemOptimizedTrieNode<CacheAlgoDataT>
pub unsafe fn copy_and_replace_fields( &self, new_value: Option<Option<Box<[u8]>>>, new_path: Option<CompressedPathRaw>, children_table: Option<ChildrenTableDeltaMpt> ) -> MemOptimizedTrieNode<CacheAlgoDataT>
new_value can only be set according to the situation. children_table can only be replaced when there is no children in both old and new table.
unsafe because:
- precondition on children_table;
- delete value assumes that self contains some value.
sourcepub fn check_delete_value(&self) -> Result<TrieNodeAction>
pub fn check_delete_value(&self) -> Result<TrieNodeAction>
Returns: old_value, is_self_about_to_delete, replacement_node_for_self
sourcepub fn check_replace_or_delete_child_action(
&self,
child_index: u8,
new_child_node: Option<NodeRefDeltaMptCompact>
) -> TrieNodeAction
pub fn check_replace_or_delete_child_action( &self, child_index: u8, new_child_node: Option<NodeRefDeltaMptCompact> ) -> TrieNodeAction
Returns old_child, is_self_about_to_delete, replacement_node_for_self
pub fn get_merkle(&self) -> &MerkleHash
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MaybeOwnedTrieNode<'a>
impl<'a> !Send for MaybeOwnedTrieNode<'a>
impl<'a> !Sync for MaybeOwnedTrieNode<'a>
impl<'a> Unpin for MaybeOwnedTrieNode<'a>
impl<'a> !UnwindSafe for MaybeOwnedTrieNode<'a>
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