Type Alias netstack3_core::testutil::Ctx

source ·
pub type Ctx<BT> = ContextPair<StackState<BT>, BT>;
Expand description

Context available during the execution of the netstack.

Aliased Type§

struct Ctx<BT> {
    pub core_ctx: StackState<BT>,
    pub bindings_ctx: BT,
}

Fields§

§core_ctx: StackState<BT>

The core context.

§bindings_ctx: BT

The bindings context.

Implementations§

source§

impl<BC: BindingsTypes> Ctx<BC>

Helper functions for dealing with fake timers.

source

pub fn trigger_next_timer<Id>(&mut self) -> Option<Id>
where BC: FakeTimerCtxExt<Id>, for<'a> UnlockedCoreCtx<'a, BC>: TimerHandler<BC, Id>,

source

pub fn trigger_timers_for<Id>(&mut self, duration: Duration) -> Vec<Id>
where BC: FakeTimerCtxExt<Id>, for<'a> UnlockedCoreCtx<'a, BC>: TimerHandler<BC, Id>,

source

pub fn trigger_timers_until_instant<Id>( &mut self, instant: FakeInstant ) -> Vec<Id>
where BC: FakeTimerCtxExt<Id>, for<'a> UnlockedCoreCtx<'a, BC>: TimerHandler<BC, Id>,

Shortcut for [FaketimerCtx::trigger_timers_until_instant].

source

pub 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>,

Trait Implementations§

source§

impl<BC: BindingsContext + Default> Default for Ctx<BC>

source§

fn default() -> Self

Returns the “default value” for a type. Read more