Struct miden_core::mast::MastNodeId
source · pub struct MastNodeId(/* private fields */);
Expand description
An opaque handle to a MastNode
in some MastForest
. It is the responsibility of the user
to use a given MastNodeId
with the corresponding MastForest
.
Note that the MastForest
does not ensure that equal MastNode
s have equal
MastNodeId
handles. Hence, MastNodeId
equality must not be used to test for equality of
the underlying MastNode
.
Implementations§
source§impl MastNodeId
impl MastNodeId
sourcepub fn from_u32_safe(
value: u32,
mast_forest: &MastForest,
) -> Result<Self, DeserializationError>
pub fn from_u32_safe( value: u32, mast_forest: &MastForest, ) -> Result<Self, DeserializationError>
Returns a new MastNodeId
with the provided inner value, or an error if the provided
value
is greater than the number of nodes in the forest.
For use in deserialization.
pub fn as_usize(&self) -> usize
pub fn as_u32(&self) -> u32
Trait Implementations§
source§impl Clone for MastNodeId
impl Clone for MastNodeId
source§fn clone(&self) -> MastNodeId
fn clone(&self) -> MastNodeId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MastNodeId
impl Debug for MastNodeId
source§impl Display for MastNodeId
impl Display for MastNodeId
source§impl From<&MastNodeId> for u32
impl From<&MastNodeId> for u32
source§fn from(value: &MastNodeId) -> Self
fn from(value: &MastNodeId) -> Self
Converts to this type from the input type.
source§impl From<MastNodeId> for u32
impl From<MastNodeId> for u32
source§fn from(value: MastNodeId) -> Self
fn from(value: MastNodeId) -> Self
Converts to this type from the input type.
source§impl From<MastNodeId> for usize
impl From<MastNodeId> for usize
source§fn from(value: MastNodeId) -> Self
fn from(value: MastNodeId) -> Self
Converts to this type from the input type.
source§impl Hash for MastNodeId
impl Hash for MastNodeId
source§impl Index<MastNodeId> for MastForest
impl Index<MastNodeId> for MastForest
source§impl Index<MastNodeId> for Program
impl Index<MastNodeId> for Program
source§impl Ord for MastNodeId
impl Ord for MastNodeId
source§fn cmp(&self, other: &MastNodeId) -> Ordering
fn cmp(&self, other: &MastNodeId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for MastNodeId
impl PartialEq for MastNodeId
source§impl PartialOrd for MastNodeId
impl PartialOrd for MastNodeId
impl Copy for MastNodeId
impl Eq for MastNodeId
impl StructuralPartialEq for MastNodeId
Auto Trait Implementations§
impl Freeze for MastNodeId
impl RefUnwindSafe for MastNodeId
impl Send for MastNodeId
impl Sync for MastNodeId
impl Unpin for MastNodeId
impl UnwindSafe for MastNodeId
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)