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,
) -> DebugInfo
pub fn with_capacity( decorators_capacity: usize, nodes_capacity: usize, operations_capacity: usize, decorator_ids_capacity: usize, ) -> DebugInfo
Creates an empty DebugInfo with specified capacities.
Sourcepub fn empty_for_nodes(num_nodes: usize) -> DebugInfo
pub fn empty_for_nodes(num_nodes: usize) -> DebugInfo
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, asm_ops, error codes, or procedure names.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Strips all debug information, removing decorators, asm_ops, error codes, and procedure names.
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 num_asm_ops(&self) -> usize
pub fn num_asm_ops(&self) -> usize
Returns the number of AssemblyOps.
Sourcepub fn asm_ops(&self) -> &[AssemblyOp]
pub fn asm_ops(&self) -> &[AssemblyOp]
Returns all AssemblyOps as a slice.
Sourcepub fn asm_op(&self, asm_op_id: AsmOpId) -> Option<&AssemblyOp>
pub fn asm_op(&self, asm_op_id: AsmOpId) -> Option<&AssemblyOp>
Returns the AssemblyOp with the given ID, if it exists.
Sourcepub fn asm_op_for_operation(
&self,
node_id: MastNodeId,
op_idx: usize,
) -> Option<&AssemblyOp>
pub fn asm_op_for_operation( &self, node_id: MastNodeId, op_idx: usize, ) -> Option<&AssemblyOp>
Returns the AssemblyOp for a specific operation within a node, if any.
Sourcepub fn first_asm_op_for_node(&self, node_id: MastNodeId) -> Option<&AssemblyOp>
pub fn first_asm_op_for_node(&self, node_id: MastNodeId) -> Option<&AssemblyOp>
Returns the first AssemblyOp for a node, if any.
Sourcepub fn add_asm_op(
&mut self,
asm_op: AssemblyOp,
) -> Result<AsmOpId, MastForestError>
pub fn add_asm_op( &mut self, asm_op: AssemblyOp, ) -> Result<AsmOpId, MastForestError>
Adds an AssemblyOp and returns its ID.
Sourcepub fn register_asm_ops(
&mut self,
node_id: MastNodeId,
num_operations: usize,
asm_ops: Vec<(usize, AsmOpId)>,
) -> Result<(), AsmOpIndexError>
pub fn register_asm_ops( &mut self, node_id: MastNodeId, num_operations: usize, asm_ops: Vec<(usize, AsmOpId)>, ) -> Result<(), AsmOpIndexError>
Registers operation-indexed AssemblyOps for a node.
The num_operations parameter must be the total number of operations in the node. This is
needed to allocate enough space for all operations, even those without AssemblyOps, so that
lookups at any valid operation index will work correctly.
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.
Sourcepub fn procedure_name(&self, digest: &Word) -> Option<&str>
pub fn procedure_name(&self, digest: &Word) -> Option<&str>
Returns the procedure name for the given MAST root digest, if present.
Sourcepub fn procedure_names(&self) -> impl Iterator<Item = (Word, &Arc<str>)>
pub fn procedure_names(&self) -> impl Iterator<Item = (Word, &Arc<str>)>
Returns an iterator over all (digest, name) pairs.
Sourcepub fn num_procedure_names(&self) -> usize
pub fn num_procedure_names(&self) -> usize
Returns the number of procedure names.
Sourcepub fn insert_procedure_name(&mut self, digest: Word, name: Arc<str>)
pub fn insert_procedure_name(&mut self, digest: Word, name: Arc<str>)
Inserts a procedure name for the given MAST root digest.
Sourcepub fn extend_procedure_names<I>(&mut self, names: I)
pub fn extend_procedure_names<I>(&mut self, names: I)
Inserts multiple procedure names at once.
Sourcepub fn clear_procedure_names(&mut self)
pub fn clear_procedure_names(&mut self)
Clears all procedure names.
Trait Implementations§
Source§impl Deserializable for DebugInfo
impl Deserializable for DebugInfo
Source§fn read_from<R>(source: &mut R) -> Result<DebugInfo, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<DebugInfo, DeserializationError>where
R: ByteReader,
source, attempts to deserialize these bytes
into Self, and returns the result. Read moreSource§fn min_serialized_size() -> usize
fn min_serialized_size() -> usize
Source§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§fn read_from_bytes_with_budget(
bytes: &[u8],
budget: usize,
) -> Result<Self, DeserializationError>
fn read_from_bytes_with_budget( bytes: &[u8], budget: usize, ) -> Result<Self, DeserializationError>
Self from bytes with a byte budget limit. Read moreSource§impl<'de> Deserialize<'de> for DebugInfo
impl<'de> Deserialize<'de> for DebugInfo
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DebugInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DebugInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serializable for DebugInfo
impl Serializable for DebugInfo
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
self into bytes and writes these bytes into the target.Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Source§impl Serialize for DebugInfo
impl Serialize for DebugInfo
Source§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 DebugInfo
impl StructuralPartialEq for DebugInfo
Auto Trait Implementations§
impl Freeze for DebugInfo
impl RefUnwindSafe for DebugInfo
impl Send for DebugInfo
impl Sync for DebugInfo
impl Unpin for DebugInfo
impl UnwindSafe for DebugInfo
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§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 moreSource§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