Struct netstack3_core::Ctx
source · pub struct Ctx<NonSyncCtx: NonSyncContext> {
pub non_sync_ctx: NonSyncCtx,
pub sync_ctx: SyncCtx<NonSyncCtx>,
}
Expand description
Context available during the execution of the netstack.
Ctx
provides access to the state of the netstack and to an event
dispatcher which can be used to emit events and schedule timers. A mutable
reference to a Ctx
is passed to every function in the netstack.
Fields§
§non_sync_ctx: NonSyncCtx
The non-synchronized context.
sync_ctx: SyncCtx<NonSyncCtx>
The synchronized context.
Implementations§
source§impl<NonSyncCtx: NonSyncContext + Default> Ctx<NonSyncCtx>
impl<NonSyncCtx: NonSyncContext + Default> Ctx<NonSyncCtx>
sourcepub fn new(state: StackState<NonSyncCtx>) -> Ctx<NonSyncCtx>
pub fn new(state: StackState<NonSyncCtx>) -> Ctx<NonSyncCtx>
Constructs a new Ctx
.