Trait netstack3_base::testutil::WithFakeTimerContext
source · pub trait WithFakeTimerContext<TimerId> {
// Required methods
fn with_fake_timer_ctx<O, F: FnOnce(&FakeTimerCtx<TimerId>) -> O>(
&self,
f: F
) -> O;
fn with_fake_timer_ctx_mut<O, F: FnOnce(&mut FakeTimerCtx<TimerId>) -> O>(
&mut self,
f: F
) -> O;
}
Expand description
A trait abstracting access to a FakeTimerCtx
instance.
Required Methods§
sourcefn with_fake_timer_ctx<O, F: FnOnce(&FakeTimerCtx<TimerId>) -> O>(
&self,
f: F
) -> O
fn with_fake_timer_ctx<O, F: FnOnce(&FakeTimerCtx<TimerId>) -> O>( &self, f: F ) -> O
Calls the callback with a borrow of FakeTimerCtx
.
sourcefn with_fake_timer_ctx_mut<O, F: FnOnce(&mut FakeTimerCtx<TimerId>) -> O>(
&mut self,
f: F
) -> O
fn with_fake_timer_ctx_mut<O, F: FnOnce(&mut FakeTimerCtx<TimerId>) -> O>( &mut self, f: F ) -> O
Calls the callback with a mutable borrow of FakeTimerCtx
.
Object Safety§
This trait is not object safe.