std.backtrace
Types
struct CallerLocation
Functions
caller_location
pub fn caller_location(): CallerLocation?
[src]
#[track_caller]
pub fn caller_location(): CallerLocation? {
let loc = _backtrace.caller_location();
if (loc.is_nil()) {
return nil;
}
return CallerLocation._from_inner(loc!);
}
Returns a CallerLocation
of the location of the caller of the current function.
caller_location
pub fn caller_location(): CallerLocation?
[src]
#[track_caller]
pub fn caller_location(): CallerLocation? {
let loc = _backtrace.caller_location();
if (loc.is_nil()) {
return nil;
}
return CallerLocation._from_inner(loc!);
}
Returns a CallerLocation
of the location of the caller of the current function.
Returns a CallerLocation
of the location of the caller of the current function.
nv,
use std.backtrace;
let loc = backtrace.caller_location();
println(loc?.to_string());
caller_locations
pub fn caller_locations(len: int? = nil): [CallerLocation]
[src]
#[track_caller]
pub fn caller_locations(len: int? = nil): [CallerLocation] {
let locations = _backtrace.caller_locations(len);
let result: [CallerLocation] = [];
for (let loc in locations) {
result.push(CallerLocation._from_inner(loc));
}
return result;
}
Returns an array of CallerLocation
representing the current call stack.
caller_locations
pub fn caller_locations(len: int? = nil): [CallerLocation]
[src]
#[track_caller]
pub fn caller_locations(len: int? = nil): [CallerLocation] {
let locations = _backtrace.caller_locations(len);
let result: [CallerLocation] = [];
for (let loc in locations) {
result.push(CallerLocation._from_inner(loc));
}
return result;
}
Returns an array of CallerLocation
representing the current call stack.
Returns an array of CallerLocation
representing the current call stack.
The len
parameter specifies the maximum number of frames to collect.
nv,
use std.backtrace;
let locations = backtrace.caller_locations();
for (let loc in locations) {
println(loc.to_string());
}