pub struct StatsRecorder { /* private fields */ }Implementations§
Source§impl StatsRecorder
impl StatsRecorder
pub fn disabled() -> Self
pub fn new(path: Option<PathBuf>) -> Self
Sourcepub fn from_env(var: &str) -> Self
pub fn from_env(var: &str) -> Self
Reads the destination from var, treating unset or empty as disabled.
pub fn is_enabled(&self) -> bool
pub fn record( &self, tool: &str, outcome: &str, duration_us: u128, args_summary: &str, )
Sourcepub fn record_with(
&self,
tool: &str,
outcome: &str,
duration_us: u128,
args_summary: &str,
extra: &[(&str, Value)],
)
pub fn record_with( &self, tool: &str, outcome: &str, duration_us: u128, args_summary: &str, extra: &[(&str, Value)], )
The same record with producer-specific fields alongside it. The reader ignores names it does not know, so a producer can carry what only it can measure (the proxy’s completion-token count, say) without every producer having to know about it.
Trait Implementations§
Source§impl Clone for StatsRecorder
impl Clone for StatsRecorder
Source§fn clone(&self) -> StatsRecorder
fn clone(&self) -> StatsRecorder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StatsRecorder
impl Debug for StatsRecorder
Source§impl Default for StatsRecorder
impl Default for StatsRecorder
Source§fn default() -> StatsRecorder
fn default() -> StatsRecorder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StatsRecorder
impl RefUnwindSafe for StatsRecorder
impl Send for StatsRecorder
impl Sync for StatsRecorder
impl Unpin for StatsRecorder
impl UnsafeUnpin for StatsRecorder
impl UnwindSafe for StatsRecorder
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