Struct NodeToDecoratorIds
pub struct NodeToDecoratorIds { /* private fields */ }Expand description
A CSR (Compressed Sparse Row) representation for storing node-level decorators (before_enter and after_exit).
This structure provides efficient storage for before_enter and after_exit decorators across all nodes in a MastForest, using a similar CSR pattern to OpToDecoratorIds but for node-level decorators.
The data layout follows CSR format. For node i:
- Before-enter decorators are stored in
before_enter.row(i) - After-exit decorators are stored in
after_exit.row(i)
Implementations§
§impl NodeToDecoratorIds
impl NodeToDecoratorIds
pub fn new() -> NodeToDecoratorIds
pub fn new() -> NodeToDecoratorIds
Creates a new empty NodeToDecoratorIds.
pub fn from_matrices(
before_enter: CsrMatrix<MastNodeId, DecoratorId>,
after_exit: CsrMatrix<MastNodeId, DecoratorId>,
) -> NodeToDecoratorIds
pub fn from_matrices( before_enter: CsrMatrix<MastNodeId, DecoratorId>, after_exit: CsrMatrix<MastNodeId, DecoratorId>, ) -> NodeToDecoratorIds
Create a NodeToDecoratorIds from raw CSR matrices.
Used during deserialization. Validation happens separately via validate_csr().
pub fn with_capacity(
nodes_capacity: usize,
before_decorators_capacity: usize,
after_decorators_capacity: usize,
) -> NodeToDecoratorIds
pub fn with_capacity( nodes_capacity: usize, before_decorators_capacity: usize, after_decorators_capacity: usize, ) -> NodeToDecoratorIds
Creates a new empty NodeToDecoratorIds with specified capacity.
pub fn add_node_decorators(
&mut self,
node_id: MastNodeId,
before: &[DecoratorId],
after: &[DecoratorId],
)
pub fn add_node_decorators( &mut self, node_id: MastNodeId, before: &[DecoratorId], after: &[DecoratorId], )
Adds decorators for a node to the centralized storage using CSR pattern.
§Arguments
node_id- The ID of the node to add decorators forbefore- Slice of before_enter decorators for this nodeafter- Slice of after_exit decorators for this node
pub fn get_before_decorators(&self, node_id: MastNodeId) -> &[DecoratorId]
pub fn get_before_decorators(&self, node_id: MastNodeId) -> &[DecoratorId]
Gets the before_enter decorators for a given node.
pub fn get_after_decorators(&self, node_id: MastNodeId) -> &[DecoratorId]
pub fn get_after_decorators(&self, node_id: MastNodeId) -> &[DecoratorId]
Gets the after_exit decorators for a given node.
pub fn finalize(&mut self)
pub fn finalize(&mut self)
Finalizes the storage by ensuring sentinel pointers are properly set. This should be called after all nodes have been added.
Note: With CsrMatrix, this is a no-op since the CSR is always in a valid state.
pub fn clear(&mut self)
pub fn clear(&mut self)
Clears all decorators and mappings.
Trait Implementations§
§impl Clone for NodeToDecoratorIds
impl Clone for NodeToDecoratorIds
§fn clone(&self) -> NodeToDecoratorIds
fn clone(&self) -> NodeToDecoratorIds
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for NodeToDecoratorIds
impl Debug for NodeToDecoratorIds
§impl Default for NodeToDecoratorIds
impl Default for NodeToDecoratorIds
§fn default() -> NodeToDecoratorIds
fn default() -> NodeToDecoratorIds
§impl<'de> Deserialize<'de> for NodeToDecoratorIds
impl<'de> Deserialize<'de> for NodeToDecoratorIds
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeToDecoratorIds, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeToDecoratorIds, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for NodeToDecoratorIds
impl PartialEq for NodeToDecoratorIds
§impl Serialize for NodeToDecoratorIds
impl Serialize for NodeToDecoratorIds
§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 Eq for NodeToDecoratorIds
impl StructuralPartialEq for NodeToDecoratorIds
Auto Trait Implementations§
impl Freeze for NodeToDecoratorIds
impl RefUnwindSafe for NodeToDecoratorIds
impl Send for NodeToDecoratorIds
impl Sync for NodeToDecoratorIds
impl Unpin for NodeToDecoratorIds
impl UnsafeUnpin for NodeToDecoratorIds
impl UnwindSafe for NodeToDecoratorIds
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