[][src]Struct source_loc::SourceLoc

pub struct SourceLoc {
    pub file: &'static str,
    pub line: u32,
    pub column: u32,
}

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 strline: u32column: u32

Trait Implementations

impl Clone for SourceLoc[src]

impl Copy for SourceLoc[src]

impl Debug for SourceLoc[src]

impl Display for SourceLoc[src]

impl Eq for SourceLoc[src]

impl Hash for SourceLoc[src]

impl PartialEq<SourceLoc> for SourceLoc[src]

impl StructuralEq for SourceLoc[src]

impl StructuralPartialEq for SourceLoc[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.