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]
pub fn new<T>(
module_path: &'static str,
file: &'static str,
line: u32,
message: T
) -> Self where
T: Into<Cow<'static, str>>,
[src]
module_path: &'static str,
file: &'static str,
line: u32,
message: T
) -> Self where
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]
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 Debug for Location
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Location
[src]
fn clone(&self) -> Location
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more