pub struct StatCounter {
pub key: &'static str,
pub count: fn(&dyn WireStats) -> u64,
pub set: fn(&mut WireStatsSnapshot, u64),
}Expand description
A mutation counter: its key in an envelope’s stats object, its key on
the Bolt wire (derived by StatCounter::bolt_key), and the
WireStats accessor it encodes — with that accessor’s inverse, so
stats_to_wire_json and stats_from_wire_json read one table.
Fields§
§key: &'static strThe counter’s key in the JSON envelope’s stats object (snake_case,
the canonical envelope vocabulary).
count: fn(&dyn WireStats) -> u64The WireStats accessor this counter encodes.
set: fn(&mut WireStatsSnapshot, u64)The inverse of count: writes this counter’s value into a
WireStatsSnapshot, so the decoder assigns the field the encoder
reads.
Implementations§
Trait Implementations§
Source§impl Clone for StatCounter
impl Clone for StatCounter
impl Copy for StatCounter
Auto Trait Implementations§
impl Forget for StatCounter
impl Freeze for StatCounter
impl Move for StatCounter
impl RefUnwindSafe for StatCounter
impl Send for StatCounter
impl Sync for StatCounter
impl Unpin for StatCounter
impl UnsafeUnpin for StatCounter
impl UnwindSafe for StatCounter
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