pub struct Metadata<'a> { /* private fields */ }
Expand description
Metadata describing a metric event. This provides additional context to Recorder
, allowing for
fine-grained filtering.
Contains the following:
- A
target
, specifying the part of the system where the metric event occurred. When initialized via the [metrics macro], and left unspecified, this defaults to the module path the macro was invoked from. - A
level
, specifying the verbosity the metric event is emitted at. - An optional
module_path
, specifying the the module path the metric event was emitted from.
Implementations§
Source§impl<'a> Metadata<'a>
impl<'a> Metadata<'a>
Sourcepub const fn new(
target: &'a str,
level: Level,
module_path: Option<&'a str>,
) -> Self
pub const fn new( target: &'a str, level: Level, module_path: Option<&'a str>, ) -> Self
Constructs a new Metadata
.
Sourcepub fn target(&self) -> &'a str
pub fn target(&self) -> &'a str
Returns the target of the metric event. This specifies the part of the system where the event occurred.
Sourcepub fn module_path(&self) -> Option<&'a str>
pub fn module_path(&self) -> Option<&'a str>
Returns the module path of the metric event. This specifies the module where the event occurred.
Trait Implementations§
impl<'a> Eq for Metadata<'a>
impl<'a> StructuralPartialEq for Metadata<'a>
Auto Trait Implementations§
impl<'a> Freeze for Metadata<'a>
impl<'a> RefUnwindSafe for Metadata<'a>
impl<'a> Send for Metadata<'a>
impl<'a> Sync for Metadata<'a>
impl<'a> Unpin for Metadata<'a>
impl<'a> UnwindSafe for Metadata<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)