pub struct SourceLoc {
pub file: &'static str,
pub line: u32,
pub column: u32,
}
Expand description
A captured source location. To capture, use the source_loc!() macro.
§Example
use source_loc::source_loc;
let loc = source_loc!();
assert_eq!(
"src/source_loc.rs:6:11",
&loc.to_string(),
);
assert_eq!(
"src/source_loc.rs",
loc.file,
);
assert_eq!(6, loc.line);
assert_eq!(11, loc.column);
Fields§
§file: &'static str
§line: u32
§column: u32
Trait Implementations§
impl Copy for SourceLoc
impl Eq for SourceLoc
impl StructuralPartialEq for SourceLoc
Auto Trait Implementations§
impl Freeze for SourceLoc
impl RefUnwindSafe for SourceLoc
impl Send for SourceLoc
impl Sync for SourceLoc
impl Unpin for SourceLoc
impl UnwindSafe for SourceLoc
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