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.