Trait netstack3_base::CounterContext
source · pub trait CounterContext<T> {
// Required method
fn with_counters<O, F: FnOnce(&T) -> O>(&self, cb: F) -> O;
// Provided methods
fn increment<F: FnOnce(&T) -> &Counter>(&self, cb: F) { ... }
fn add<F: FnOnce(&T) -> &Counter>(&self, n: u64, cb: F) { ... }
}
Expand description
A context that stores counters.
CounterContext
exposes access to counters for observation and debugging.
Required Methods§
sourcefn with_counters<O, F: FnOnce(&T) -> O>(&self, cb: F) -> O
fn with_counters<O, F: FnOnce(&T) -> O>(&self, cb: F) -> O
Call the function with an immutable reference to counter type T.
Provided Methods§
Object Safety§
This trait is not object safe.