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
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.