pub struct RouterContext {
pub custom_fixture_loader: Option<Arc<CustomFixtureLoader>>,
pub latency_injector: Option<LatencyInjector>,
pub failure_injector: Option<FailureInjector>,
pub response_rewriter: Option<Arc<dyn ResponseRewriter>>,
pub overrides_enabled: bool,
pub ai_generator: Option<Arc<dyn AiGenerator + Send + Sync>>,
pub mockai: Option<Arc<RwLock<dyn MockAiBehavior + Send + Sync>>>,
pub enable_full_validation: bool,
pub enable_template_expand: bool,
pub add_spec_endpoint: bool,
}Expand description
Shared context for all route handlers, encapsulating optional features.
Each build_router_* variant constructs a RouterContext with the appropriate
features enabled, then delegates to build_router_with_context.
Fields§
§custom_fixture_loader: Option<Arc<CustomFixtureLoader>>Custom fixture loader (highest priority response source)
latency_injector: Option<LatencyInjector>Latency injector (per-operation-tag latency simulation)
failure_injector: Option<FailureInjector>Failure injector (per-tag fault injection)
response_rewriter: Option<Arc<dyn ResponseRewriter>>Response-body mutation hook — used for template token expansion
and override rule application. Core’s concrete impl is
[crate::openapi_rewriter::CoreResponseRewriter].
overrides_enabled: boolWhether override application is active (gates the
ResponseRewriter::apply_overrides call).
ai_generator: Option<Arc<dyn AiGenerator + Send + Sync>>AI response generator
mockai: Option<Arc<RwLock<dyn MockAiBehavior + Send + Sync>>>MockAI intelligent behavior handle (type-erased via
mockforge_foundation::intelligent_behavior::MockAiBehavior so
the OpenAPI router doesn’t depend on core’s concrete MockAI).
enable_full_validation: boolEnable full validation (422 enhanced responses, response validation, trace)
enable_template_expand: boolEnable template token expansion
add_spec_endpoint: boolWhether to add /openapi.json endpoint
Trait Implementations§
Source§impl Clone for RouterContext
impl Clone for RouterContext
Source§fn clone(&self) -> RouterContext
fn clone(&self) -> RouterContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RouterContext
impl !RefUnwindSafe for RouterContext
impl Send for RouterContext
impl Sync for RouterContext
impl Unpin for RouterContext
impl UnsafeUnpin for RouterContext
impl !UnwindSafe for RouterContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more