Skip to main content

StackTraceProvider

Trait StackTraceProvider 

Source
pub trait StackTraceProvider {
    type Error;

    // Required methods
    fn get_stack_trace(
        &self,
        thread_id: i64,
        start_frame: usize,
        levels: Option<usize>,
    ) -> Result<Vec<StackFrame>, Self::Error>;
    fn total_frames(&self, thread_id: i64) -> Result<usize, Self::Error>;
    fn get_frame(
        &self,
        frame_id: i64,
    ) -> Result<Option<StackFrame>, Self::Error>;
}
Expand description

Trait for providing stack traces.

Implementations of this trait retrieve stack trace information from a debugging session.

Required Associated Types§

Source

type Error

The error type for stack trace retrieval.

Required Methods§

Source

fn get_stack_trace( &self, thread_id: i64, start_frame: usize, levels: Option<usize>, ) -> Result<Vec<StackFrame>, Self::Error>

Gets the current stack trace.

§Arguments
  • thread_id - The thread to get the stack trace for
  • start_frame - The starting frame index (0-based)
  • levels - Maximum number of frames to return (None = all)
§Returns

A vector of stack frames, ordered from innermost (current) to outermost.

Source

fn total_frames(&self, thread_id: i64) -> Result<usize, Self::Error>

Gets the total number of frames in the stack.

§Arguments
  • thread_id - The thread to query
Source

fn get_frame(&self, frame_id: i64) -> Result<Option<StackFrame>, Self::Error>

Gets a single frame by ID.

§Arguments
  • frame_id - The frame identifier

Implementors§