Struct bdrck::testing::fn_instrumentation::FnInstrumentation
source · pub struct FnInstrumentation { /* private fields */ }
Expand description
This is a structure which contains the state relating to instrumenting a function. The idea is that you would mutate it via its member functions to e.g. record information about a function call. Because it has internal synchronization, this can be done without retaining a mutable reference.
Implementations§
source§impl FnInstrumentation
impl FnInstrumentation
sourcepub fn new() -> FnInstrumentation
pub fn new() -> FnInstrumentation
Construct a new instrumentation state, with default-initialized values.
sourcepub fn record_call(&self)
pub fn record_call(&self)
Record that the function being instrumented was called by incrementing a counter.
sourcepub fn get_call_count(&self) -> u64
pub fn get_call_count(&self) -> u64
Return the current number of calls recorded.
Auto Trait Implementations§
impl RefUnwindSafe for FnInstrumentation
impl Send for FnInstrumentation
impl Sync for FnInstrumentation
impl Unpin for FnInstrumentation
impl UnwindSafe for FnInstrumentation
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