Struct trackable::Location[][src]

pub struct Location { /* fields omitted */ }

The location of interest in source code files.

Typically this is created in the macros which defined in this crate.

Implementations

impl Location[src]

pub fn new<M, F, T>(module_path: M, file: F, line: u32, message: T) -> Location where
    T: Into<Cow<'static, str>>,
    F: Into<Cow<'static, str>>,
    M: Into<Cow<'static, str>>, 
[src]

Makes a new Location instance.

Examples

use trackable::Location;

let location = Location::new(module_path!(), file!(), line!(), "Hello".to_string());
assert_eq!(location.message(), "Hello");

pub fn crate_name(&self) -> &str[src]

Gets the crate name of this location.

pub fn module_path(&self) -> &str[src]

Gets the module path of this location.

pub fn file(&self) -> &str[src]

Gets the file name of this location.

pub fn line(&self) -> u32[src]

Gets the line of this location.

pub fn message(&self) -> &str[src]

Gets the message left at this location.

Trait Implementations

impl Clone for Location[src]

impl Debug for Location[src]

impl<'de> Deserialize<'de> for Location[src]

impl Display for Location[src]

impl Serialize for Location[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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.