pub struct SourceLoc {
pub file: &'static str,
pub line: u32,
}Fields§
§file: &'static str§line: u32Implementations§
Source§impl SourceLoc
impl SourceLoc
pub const fn new(file: &'static str, line: u32) -> Self
Sourcepub fn matches_path(&self, target: &str) -> bool
pub fn matches_path(&self, target: &str) -> bool
Match this source location against a path supplied on the command
line. The match is a suffix match — the user typically supplies a
workspace-relative path while file!() returns a path relative to
the crate the macro expanded in. Matching by suffix accommodates
both without requiring path canonicalisation.
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 UnsafeUnpin 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