pub struct ClosureGauge<F>(/* private fields */)
where
F: Fn(&MetricConfig, i64) -> MetricValue + Send + Sync;Expand description
A Gauge backed by a closure, mirroring Java’s functional-interface usage
(e.g. (config, now) -> metrics.size()).
Implementations§
Source§impl<F> ClosureGauge<F>
impl<F> ClosureGauge<F>
Trait Implementations§
Source§impl<F> Gauge for ClosureGauge<F>
impl<F> Gauge for ClosureGauge<F>
Source§fn value(&self, config: &MetricConfig, now: i64) -> MetricValue
fn value(&self, config: &MetricConfig, now: i64) -> MetricValue
Returns the current value associated with this gauge. Read more
Auto Trait Implementations§
impl<F> Freeze for ClosureGauge<F>where
F: Freeze,
impl<F> RefUnwindSafe for ClosureGauge<F>where
F: RefUnwindSafe,
impl<F> Send for ClosureGauge<F>
impl<F> Sync for ClosureGauge<F>
impl<F> Unpin for ClosureGauge<F>where
F: Unpin,
impl<F> UnsafeUnpin for ClosureGauge<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for ClosureGauge<F>where
F: UnwindSafe,
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