Struct MastNodeId
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§
§impl MastNodeId
impl MastNodeId
pub 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.
pub 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 new_unchecked(value: u32) -> MastNodeId
pub fn new_unchecked(value: u32) -> MastNodeId
Returns a new MastNodeId from the given value without checking its validity.
pub 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§
§impl Arbitrary for MastNodeId
Available on crate features arbitrary only.
impl Arbitrary for MastNodeId
arbitrary only.§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.§type Strategy = BoxedStrategy<MastNodeId>
type Strategy = BoxedStrategy<MastNodeId>
Strategy used to generate values of type Self.§fn arbitrary_with(
_args: <MastNodeId as Arbitrary>::Parameters,
) -> <MastNodeId as Arbitrary>::Strategy
fn arbitrary_with( _args: <MastNodeId as Arbitrary>::Parameters, ) -> <MastNodeId as Arbitrary>::Strategy
§impl Clone for MastNodeId
impl Clone for MastNodeId
§fn clone(&self) -> MastNodeId
fn clone(&self) -> MastNodeId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for MastNodeId
impl Debug for MastNodeId
§impl<'de> Deserialize<'de> for MastNodeId
impl<'de> Deserialize<'de> for MastNodeId
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MastNodeId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MastNodeId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for MastNodeId
impl Display for MastNodeId
§impl From<u32> for MastNodeId
impl From<u32> for MastNodeId
§fn from(value: u32) -> MastNodeId
fn from(value: u32) -> MastNodeId
§impl Hash for MastNodeId
impl Hash for MastNodeId
§impl Index<MastNodeId> for MastForest
impl Index<MastNodeId> for MastForest
§fn index(
&self,
node_id: MastNodeId,
) -> &<MastForest as Index<MastNodeId>>::Output
fn index( &self, node_id: MastNodeId, ) -> &<MastForest as Index<MastNodeId>>::Output
container[index]) operation. Read more§impl IndexMut<MastNodeId> for MastForest
impl IndexMut<MastNodeId> for MastForest
§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
container[index]) operation. Read more§impl Ord for MastNodeId
impl Ord for MastNodeId
§impl PartialEq for MastNodeId
impl PartialEq for MastNodeId
§impl PartialOrd for MastNodeId
impl PartialOrd for MastNodeId
§impl Serialize for MastNodeId
impl Serialize for MastNodeId
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more