pub struct Location { /* private fields */ }Expand description
The context of a log message.
Implementations§
Source§impl Location
impl Location
Sourcepub const fn new(
module_path: &'static str,
file: &'static str,
line: u32,
) -> Self
pub const fn new( module_path: &'static str, file: &'static str, line: u32, ) -> Self
Creates a new instance of a log message location.
This function is const to let the caller store location structures in statics.
§Arguments
module_path: the module path obtained from the module_path macro.file: the source file obtained from the file macro.line: the line number in the source file obtained from the line macro.
returns: Metadata
Sourcepub fn module_path(&self) -> &'static str
pub fn module_path(&self) -> &'static str
The module path which issued this log message.
Sourcepub fn get_target_module(&self) -> (&'static str, &'static str)
pub fn get_target_module(&self) -> (&'static str, &'static str)
Extracts the target name and the module name from the module path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Location
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