Struct oasis_core_runtime::storage::mkvs::NodePointer
source · pub struct NodePointer {
pub clean: bool,
pub hash: Hash,
pub node: Option<Rc<RefCell<NodeBox>>>,
pub cache_extra: Option<NonNull<CacheItemBox<NodePointer>>>,
}
Expand description
A pointer to a node in the tree.
Fields§
§clean: bool
§hash: Hash
§node: Option<Rc<RefCell<NodeBox>>>
§cache_extra: Option<NonNull<CacheItemBox<NodePointer>>>
Implementations§
source§impl NodePointer
impl NodePointer
sourcepub fn null_ptr() -> NodePtrRef
pub fn null_ptr() -> NodePtrRef
Construct a null pointer.
sourcepub fn hash_ptr(hash: Hash) -> NodePtrRef
pub fn hash_ptr(hash: Hash) -> NodePtrRef
Construct a hash-only pointer.
sourcepub fn from_node(node: NodeBox) -> NodePtrRef
pub fn from_node(node: NodeBox) -> NodePtrRef
Construct a node pointer from a full node.
sourcepub fn has_node(&self) -> bool
pub fn has_node(&self) -> bool
Check if the pointer has a resolved reference to a concrete node.
sourcepub fn get_node(&self) -> Rc<RefCell<NodeBox>>
pub fn get_node(&self) -> Rc<RefCell<NodeBox>>
Get a reference to the node the pointer is pointing to.
sourcepub fn extract(&self) -> NodePtrRef
pub fn extract(&self) -> NodePtrRef
Return a copy of this pointer containing only hash references.
Trait Implementations§
source§impl Debug for NodePointer
impl Debug for NodePointer
source§impl Default for NodePointer
impl Default for NodePointer
source§fn default() -> NodePointer
fn default() -> NodePointer
Returns the “default value” for a type. Read more
source§impl PartialEq for NodePointer
impl PartialEq for NodePointer
source§fn eq(&self, other: &NodePointer) -> bool
fn eq(&self, other: &NodePointer) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for NodePointer
Auto Trait Implementations§
impl Freeze for NodePointer
impl !RefUnwindSafe for NodePointer
impl !Send for NodePointer
impl !Sync for NodePointer
impl Unpin for NodePointer
impl !UnwindSafe for NodePointer
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.