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 MastNodes 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<MastNodeId, DeserializationError>
 
pub fn from_u32_safe( value: u32, mast_forest: &MastForest, ) -> Result<MastNodeId, 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.
Sourcepub fn from_usize_safe(
    node_id: usize,
    mast_forest: &MastForest,
) -> Result<MastNodeId, DeserializationError>
 
pub fn from_usize_safe( node_id: usize, mast_forest: &MastForest, ) -> Result<MastNodeId, DeserializationError>
Returns a new MastNodeId with the provided node_id, or an error if node_id is
greater than the number of nodes in the MastForest for which this ID is being
constructed.
pub fn as_usize(&self) -> usize
pub fn as_u32(&self) -> u32
Sourcepub fn remap(&self, remapping: &BTreeMap<MastNodeId, MastNodeId>) -> MastNodeId
 
pub fn remap(&self, remapping: &BTreeMap<MastNodeId, MastNodeId>) -> MastNodeId
Remap the NodeId to its new position using the given Remapping.
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 Hash for MastNodeId
 
impl Hash for MastNodeId
Source§impl Index<MastNodeId> for MastForest
 
impl Index<MastNodeId> for MastForest
Source§fn index(
    &self,
    node_id: MastNodeId,
) -> &<MastForest as Index<MastNodeId>>::Output
 
fn index( &self, node_id: MastNodeId, ) -> &<MastForest as Index<MastNodeId>>::Output
Performs the indexing (
container[index]) operation. Read moreSource§impl IndexMut<MastNodeId> for MastForest
 
impl IndexMut<MastNodeId> for MastForest
Source§fn index_mut(
    &mut self,
    node_id: MastNodeId,
) -> &mut <MastForest as Index<MastNodeId>>::Output
 
fn index_mut( &mut self, node_id: MastNodeId, ) -> &mut <MastForest as Index<MastNodeId>>::Output
Performs the mutable indexing (
container[index]) operation. Read moreSource§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