pub trait CtxPairExt<BC: BindingsContext> {
// Required methods
fn contexts(&mut self) -> (UnlockedCoreCtx<'_, BC>, &mut BC);
fn core_ctx(&self) -> UnlockedCoreCtx<'_, BC>;
// Provided methods
fn core_api(&mut self) -> CoreApi<'_, &mut BC> { ... }
fn test_api(&mut self) -> TestApi<'_, BC> { ... }
fn trigger_next_timer<Id>(&mut self) -> Option<Id>
where BC: FakeTimerCtxExt<Id>,
for<'a> UnlockedCoreCtx<'a, BC>: TimerHandler<BC, Id> { ... }
fn trigger_timers_for<Id>(&mut self, duration: Duration) -> Vec<Id>
where BC: FakeTimerCtxExt<Id>,
for<'a> UnlockedCoreCtx<'a, BC>: TimerHandler<BC, Id> { ... }
fn trigger_timers_until_instant<Id>(
&mut self,
instant: FakeInstant,
) -> Vec<Id>
where BC: FakeTimerCtxExt<Id>,
for<'a> UnlockedCoreCtx<'a, BC>: TimerHandler<BC, Id> { ... }
fn trigger_timers_until_and_expect_unordered<Id, I: IntoIterator<Item = Id>>(
&mut self,
instant: FakeInstant,
timers: I,
)
where Id: Debug + Hash + Eq,
BC: FakeTimerCtxExt<Id>,
for<'a> UnlockedCoreCtx<'a, BC>: TimerHandler<BC, Id> { ... }
}Expand description
Extensions to CtxPair when it holds a full stack state.
Required Methods§
Sourcefn contexts(&mut self) -> (UnlockedCoreCtx<'_, BC>, &mut BC)
fn contexts(&mut self) -> (UnlockedCoreCtx<'_, BC>, &mut BC)
Retrieves the core and bindings context, respectively.
This function can be used to call into non-api core functions that want a core context.
Sourcefn core_ctx(&self) -> UnlockedCoreCtx<'_, BC>
fn core_ctx(&self) -> UnlockedCoreCtx<'_, BC>
Like CtxPairExt::contexts, but retrieves only the core context.
Provided Methods§
Sourcefn trigger_next_timer<Id>(&mut self) -> Option<Id>
fn trigger_next_timer<Id>(&mut self) -> Option<Id>
Shortcut for FakeTimerCtxExt::trigger_next_timer.
Sourcefn trigger_timers_for<Id>(&mut self, duration: Duration) -> Vec<Id>
fn trigger_timers_for<Id>(&mut self, duration: Duration) -> Vec<Id>
Shortcut for FakeTimerCtxExt::trigger_timers_for.
Sourcefn trigger_timers_until_instant<Id>(&mut self, instant: FakeInstant) -> Vec<Id>
fn trigger_timers_until_instant<Id>(&mut self, instant: FakeInstant) -> Vec<Id>
Shortcut for [FaketimerCtx::trigger_timers_until_instant].
Sourcefn trigger_timers_until_and_expect_unordered<Id, I: IntoIterator<Item = Id>>(
&mut self,
instant: FakeInstant,
timers: I,
)where
Id: Debug + Hash + Eq,
BC: FakeTimerCtxExt<Id>,
for<'a> UnlockedCoreCtx<'a, BC>: TimerHandler<BC, Id>,
fn trigger_timers_until_and_expect_unordered<Id, I: IntoIterator<Item = Id>>(
&mut self,
instant: FakeInstant,
timers: I,
)where
Id: Debug + Hash + Eq,
BC: FakeTimerCtxExt<Id>,
for<'a> UnlockedCoreCtx<'a, BC>: TimerHandler<BC, Id>,
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.