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.
Methods
impl Location
[src]
impl Location
pub fn new<M, F, T>(module_path: M, file: F, line: u32, message: T) -> Self where
M: Into<Cow<'static, str>>,
F: Into<Cow<'static, str>>,
T: Into<Cow<'static, str>>,
[src]
pub fn new<M, F, T>(module_path: M, file: F, line: u32, message: T) -> Self where
M: Into<Cow<'static, str>>,
F: Into<Cow<'static, str>>,
T: Into<Cow<'static, str>>,
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]
pub fn crate_name(&self) -> &str
Gets the crate name of this location.
pub fn module_path(&self) -> &str
[src]
pub fn module_path(&self) -> &str
Gets the module path of this location.
pub fn file(&self) -> &str
[src]
pub fn file(&self) -> &str
Gets the file name of this location.
pub fn line(&self) -> u32
[src]
pub fn line(&self) -> u32
Gets the line of this location.
pub fn message(&self) -> &str
[src]
pub fn message(&self) -> &str
Gets the message left at this location.
Trait Implementations
impl Debug for Location
[src]
impl Debug for Location
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Location
[src]
impl Clone for Location
fn clone(&self) -> Location
[src]
fn clone(&self) -> Location
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Display for Location
[src]
impl Display for Location