Trait 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§

Source

fn with_fake_timer_ctx<O, F: FnOnce(&FakeTimerCtx<TimerId>) -> O>( &self, f: F, ) -> O

Calls the callback with a borrow of FakeTimerCtx.

Source

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.

Implementors§

Source§

impl<TimerId> WithFakeTimerContext<TimerId> for FakeTimerCtx<TimerId>

Source§

impl<TimerId, CC, BC> WithFakeTimerContext<TimerId> for CtxPair<CC, BC>
where BC: WithFakeTimerContext<TimerId>,

Source§

impl<TimerId, Event: Debug, State, FrameMeta> WithFakeTimerContext<TimerId> for FakeBindingsCtx<TimerId, Event, State, FrameMeta>