stacky
Types
pub type ErlangFileName {
ErlangFileName(String)
}
Constructors
-
ErlangFileName(String)
pub type ErlangLineNumber {
ErlangLineNumber(Int)
}
Constructors
-
ErlangLineNumber(Int)
pub type ErlangModuleName {
ErlangModuleName(String)
}
Constructors
-
ErlangModuleName(String)
pub type FunctionArity {
FunctionArity(Int)
}
Constructors
-
FunctionArity(Int)
pub type FunctionName {
FunctionName(String)
}
Constructors
-
FunctionName(String)
pub type StackFrame {
StackFrame(
index: StackIndex,
erlang_module_name: ErlangModuleName,
function_name: FunctionName,
function_arity: FunctionArity,
erlang_file_name: ErlangFileName,
erlang_line_number: ErlangLineNumber,
)
}
Constructors
-
StackFrame( index: StackIndex, erlang_module_name: ErlangModuleName, function_name: FunctionName, function_arity: FunctionArity, erlang_file_name: ErlangFileName, erlang_line_number: ErlangLineNumber, )
pub type StackIndex {
StackIndex(Int)
}
Constructors
-
StackIndex(Int)
pub type StackTrace {
StackTrace(List(StackFrame))
}
Constructors
-
StackTrace(List(StackFrame))
Functions
pub fn erlang_file_name(stack_frame: StackFrame) -> String
Gets the erlang file name of the stack frame.
pub fn erlang_line_number(stack_frame: StackFrame) -> Int
Gets the ang erlline number of the stack frame.
pub fn erlang_module_name(stack_frame: StackFrame) -> String
Gets the erlang module name of the stack frame.
pub fn frame(stack_trace: StackTrace, index: Int) -> StackFrame
Gets the stack frame at the given 0-based list index
where 0
is the last stack frame and 1
is the
second-to-last stack frame and size(stack_trace) - 1
is the first stack frame.
The StackFrame itself has an inverse index field
that represents the index of the frame within the stack.
see frame_by_stack_index
.
pub fn frame_by_stack_index(
stack_trace: StackTrace,
index: Int,
) -> StackFrame
Gets the stack frame at the given 1-based stack index,
where 1
is the first stack frame, 2
is the second stack frame,
and size(stack_trace) is the last stack frame.
pub fn frame_to_string(stack_frame: StackFrame) -> String
Converts a stack frame to a string.
pub fn function_arity(stack_frame: StackFrame) -> Int
Gets the function arity of the stack frame.
pub fn function_name(stack_frame: StackFrame) -> String
Gets the function name of the stack frame.
pub fn main() -> Nil
This is a library and the main function exists as a placeholder if called as a function from the command line.
pub fn print_frame_with(
stack_frame: StackFrame,
context c: a,
) -> Nil
Print a stack frame with context.
pub fn print_trace_with(
stack_trace: StackTrace,
context c: a,
) -> Nil
Print a stack trace with context.
pub fn qualified_module_name(stack_frame: StackFrame) -> String
Gets the qualified module name from the erlang stack frame.
In case the module name contains @
(but no @@
),
those will be replaced with /
to form a qualified module name.
pub fn stack_index(stack_frame: StackFrame) -> Int
Gets the stack index within its parent stack frame.
pub fn trace_to_string(stack_frame: StackTrace) -> String
Converts a stack trace to a string.