pub struct OpenApiRouteRegistry { /* private fields */ }
Expand description
OpenAPI route registry that manages generated routes
Implementations§
Source§impl OpenApiRouteRegistry
impl OpenApiRouteRegistry
Sourcepub fn new(spec: OpenApiSpec) -> Self
pub fn new(spec: OpenApiSpec) -> Self
Create a new registry from an OpenAPI spec
pub fn new_with_env(spec: OpenApiSpec) -> Self
Sourcepub fn new_with_options(spec: OpenApiSpec, options: ValidationOptions) -> Self
pub fn new_with_options(spec: OpenApiSpec, options: ValidationOptions) -> Self
Construct with explicit options
Sourcepub fn routes(&self) -> &[OpenApiRoute]
pub fn routes(&self) -> &[OpenApiRoute]
Get all routes
Sourcepub fn spec(&self) -> &OpenApiSpec
pub fn spec(&self) -> &OpenApiSpec
Get the OpenAPI specification
Sourcepub fn options(&self) -> &ValidationOptions
pub fn options(&self) -> &ValidationOptions
Get validation options
Sourcepub fn options_mut(&mut self) -> &mut ValidationOptions
pub fn options_mut(&mut self) -> &mut ValidationOptions
Get mutable validation options
Sourcepub fn build_router(&self) -> Router
pub fn build_router(&self) -> Router
Build an Axum router from the generated routes
Sourcepub fn build_router_with_injectors(
&self,
latency_injector: LatencyInjector,
failure_injector: Option<FailureInjector>,
) -> Router
pub fn build_router_with_injectors( &self, latency_injector: LatencyInjector, failure_injector: Option<FailureInjector>, ) -> Router
Build router with injectors (latency, failure)
Sourcepub fn extract_path_parameters(
&self,
path: &str,
method: &str,
) -> HashMap<String, String>
pub fn extract_path_parameters( &self, path: &str, method: &str, ) -> HashMap<String, String>
Extract path parameters from a request path by matching against known routes
Sourcepub fn build_router_with_ai(
&self,
ai_generator: Option<Arc<dyn AiGenerator + Send + Sync>>,
) -> Router
pub fn build_router_with_ai( &self, ai_generator: Option<Arc<dyn AiGenerator + Send + Sync>>, ) -> Router
Build router with AI generator support
Trait Implementations§
Source§impl Clone for OpenApiRouteRegistry
impl Clone for OpenApiRouteRegistry
Source§fn clone(&self) -> OpenApiRouteRegistry
fn clone(&self) -> OpenApiRouteRegistry
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 OpenApiRouteRegistry
impl RefUnwindSafe for OpenApiRouteRegistry
impl Send for OpenApiRouteRegistry
impl Sync for OpenApiRouteRegistry
impl Unpin for OpenApiRouteRegistry
impl UnwindSafe for OpenApiRouteRegistry
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