pub struct CallerInfo {
pub file: String,
pub line: u32,
pub function: String,
}Expand description
Caller information extracted from the call stack.
Fields§
§file: StringSource file path.
line: u32Line number.
function: StringFunction name.
Implementations§
Source§impl CallerInfo
impl CallerInfo
Sourcepub fn capture(skip: usize) -> Option<Self>
pub fn capture(skip: usize) -> Option<Self>
Extracts caller information from the current call stack.
The skip parameter indicates how many frames to skip from the
logging infrastructure to find the actual caller.
§Performance Warning
This method captures a full stack backtrace and performs symbol resolution, which is a very expensive operation (~100μs or more). Avoid calling this in hot paths or production code.
Typical overhead: 100-1000x slower than a normal log call.
Trait Implementations§
Source§impl Clone for CallerInfo
impl Clone for CallerInfo
Source§fn clone(&self) -> CallerInfo
fn clone(&self) -> CallerInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CallerInfo
impl RefUnwindSafe for CallerInfo
impl Send for CallerInfo
impl Sync for CallerInfo
impl Unpin for CallerInfo
impl UnwindSafe for CallerInfo
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
Mutably borrows from an owned value. Read more