pub struct DebugInfo { /* private fields */ }Expand description
Debug information for a MAST forest, containing decorators and error messages.
Implementations§
Source§impl DebugInfo
impl DebugInfo
Sourcepub fn with_capacity(
decorators_capacity: usize,
nodes_capacity: usize,
operations_capacity: usize,
decorator_ids_capacity: usize,
) -> Self
pub fn with_capacity( decorators_capacity: usize, nodes_capacity: usize, operations_capacity: usize, decorator_ids_capacity: usize, ) -> Self
Creates an empty DebugInfo with specified capacities.
Sourcepub fn empty_for_nodes(num_nodes: usize) -> Self
pub fn empty_for_nodes(num_nodes: usize) -> Self
Creates an empty DebugInfo with valid CSR structures for N nodes.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if this DebugInfo has no decorators or error codes.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Strips all debug information, removing decorators and error codes.
This is used for release builds where debug info is not needed.
Sourcepub fn num_decorators(&self) -> usize
pub fn num_decorators(&self) -> usize
Returns the number of decorators.
Sourcepub fn decorators(&self) -> &[Decorator]
pub fn decorators(&self) -> &[Decorator]
Returns all decorators as a slice.
Sourcepub fn decorator(&self, decorator_id: DecoratorId) -> Option<&Decorator>
pub fn decorator(&self, decorator_id: DecoratorId) -> Option<&Decorator>
Returns the decorator with the given ID, if it exists.
Sourcepub fn before_enter_decorators(&self, node_id: MastNodeId) -> &[DecoratorId]
pub fn before_enter_decorators(&self, node_id: MastNodeId) -> &[DecoratorId]
Returns the before-enter decorators for the given node.
Sourcepub fn after_exit_decorators(&self, node_id: MastNodeId) -> &[DecoratorId]
pub fn after_exit_decorators(&self, node_id: MastNodeId) -> &[DecoratorId]
Returns the after-exit decorators for the given node.
Sourcepub fn decorators_for_operation(
&self,
node_id: MastNodeId,
local_op_idx: usize,
) -> &[DecoratorId]
pub fn decorators_for_operation( &self, node_id: MastNodeId, local_op_idx: usize, ) -> &[DecoratorId]
Returns decorators for a specific operation within a node.
Sourcepub fn add_decorator(
&mut self,
decorator: Decorator,
) -> Result<DecoratorId, MastForestError>
pub fn add_decorator( &mut self, decorator: Decorator, ) -> Result<DecoratorId, MastForestError>
Adds a decorator and returns its ID.
Sourcepub fn clear_mappings(&mut self)
pub fn clear_mappings(&mut self)
Clears all decorator information while preserving error codes.
This is used when rebuilding decorator information from nodes.
Sourcepub fn error_codes(&self) -> impl Iterator<Item = (&u64, &Arc<str>)>
pub fn error_codes(&self) -> impl Iterator<Item = (&u64, &Arc<str>)>
Returns an iterator over error codes.
Sourcepub fn insert_error_code(&mut self, code: u64, msg: Arc<str>)
pub fn insert_error_code(&mut self, code: u64, msg: Arc<str>)
Inserts an error code with its message.
Sourcepub fn extend_error_codes<I>(&mut self, error_codes: I)
pub fn extend_error_codes<I>(&mut self, error_codes: I)
Inserts multiple error codes at once.
This is used when bulk error code insertion is needed.
Sourcepub fn clear_error_codes(&mut self)
pub fn clear_error_codes(&mut self)
Clears all error codes.
This is used when error code information needs to be reset.