pub struct RouterContext {
pub custom_fixture_loader: Option<Arc<CustomFixtureLoader>>,
pub latency_injector: Option<LatencyInjector>,
pub failure_injector: Option<FailureInjector>,
pub overrides: Option<Overrides>,
pub overrides_enabled: bool,
pub ai_generator: Option<Arc<dyn AiGenerator + Send + Sync>>,
pub mockai: Option<Arc<RwLock<MockAI>>>,
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)
overrides: Option<Overrides>Response overrides
overrides_enabled: boolWhether overrides are active
ai_generator: Option<Arc<dyn AiGenerator + Send + Sync>>AI response generator
mockai: Option<Arc<RwLock<MockAI>>>MockAI intelligent behavior engine
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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