Trait netstack3_base::ContextPair
source · pub trait ContextPair {
type CoreContext;
type BindingsContext;
// Required method
fn contexts(
&mut self,
) -> (&mut Self::CoreContext, &mut Self::BindingsContext);
// Provided methods
fn core_ctx(&mut self) -> &mut Self::CoreContext { ... }
fn bindings_ctx(&mut self) -> &mut Self::BindingsContext { ... }
}
Expand description
A pair of core and bindings contexts.
This trait exists so implementers can be agnostic on the storage of the contexts, since all we need from a context pair is mutable references from both contexts.
Required Associated Types§
sourcetype CoreContext
type CoreContext
The core context type held by this pair.
sourcetype BindingsContext
type BindingsContext
The bindings context type held by this pair.
Required Methods§
sourcefn contexts(&mut self) -> (&mut Self::CoreContext, &mut Self::BindingsContext)
fn contexts(&mut self) -> (&mut Self::CoreContext, &mut Self::BindingsContext)
Gets a mutable reference to both contexts.
Provided Methods§
sourcefn core_ctx(&mut self) -> &mut Self::CoreContext
fn core_ctx(&mut self) -> &mut Self::CoreContext
Gets a mutable reference to the core context.
sourcefn bindings_ctx(&mut self) -> &mut Self::BindingsContext
fn bindings_ctx(&mut self) -> &mut Self::BindingsContext
Gets a mutable reference to the bindings context.