pub struct Location { /* private fields */ }
Expand description
The location of interest in source code files.
Typically this is created in the macros which defined in this crate.
Implementations§
source§impl Location
impl Location
sourcepub fn new<M, F, T>(module_path: M, file: F, line: u32, message: T) -> Selfwhere
M: Into<Cow<'static, str>>,
F: Into<Cow<'static, str>>,
T: Into<Cow<'static, str>>,
pub fn new<M, F, T>(module_path: M, file: F, line: u32, message: T) -> Selfwhere 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");
sourcepub fn crate_name(&self) -> &str
pub fn crate_name(&self) -> &str
Gets the crate name of this location.
sourcepub fn module_path(&self) -> &str
pub fn module_path(&self) -> &str
Gets the module path of this location.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Location
impl<'de> Deserialize<'de> for Location
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
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