Expand description
Type-safe API operation builder with compile-time guarantees
This module implements a type-state builder pattern that ensures:
register()cannot be called unless a handler is setregister()cannot be called unless at least one response is declared- Descriptive methods remain available at any stage
- No panics or unwraps in production hot paths
- Request body support (
json_request,json_request_schema) so POST/PUT calls are invokable in UI - Schema-aware responses (
json_response_with_schema) - Typed Router state
Susage pattern: pass a state type once viaRouter::with_state, then use plain function handlers (no per-route closures that capture/clones). - Optional
method_router(...)for advanced use (layers/middleware on route level).
Re-exports§
pub use state::AuthNotSet;pub use state::AuthSet;pub use state::LicenseNotSet;pub use state::LicenseSet;pub use state::Missing;pub use state::Present;pub use crate::api::openapi_registry::OpenApiRegistry;pub use crate::api::openapi_registry::ensure_schema;
Modules§
- state
- Type-state markers for compile-time enforcement
Structs§
- License
ReqSpec - License requirement specification for an operation
- OData
Pagination - Operation
Builder - Type-safe operation builder with compile-time guarantees.
- Operation
SecRequirement - Security requirement for an operation (resource:action pattern)
- Operation
Spec - Simplified operation specification for the type-safe builder
- Param
Spec - Parameter specification for API operations
- Rate
Limit Spec - Per-operation rate & concurrency limit specification
- Request
Body Spec - Request body specification for API operations
- Response
Spec - Response specification for API operations
- Vendor
Extensions - XPagination
Enums§
- Param
Location - Request
Body Schema - Request body schema variants for different kinds of request bodies
Traits§
- Auth
ReqAction - Auth
ReqResource - Auth
State - Sealed trait for auth state markers
- Handler
Slot - License
Feature - License
State - Operation
BuilderO Data Ext
Functions§
- axum_
to_ openapi_ path - Convert Axum 0.8+ style path parameters to OpenAPI-style placeholders.
- normalize_
to_ axum_ path - Convert OpenAPI-style path placeholders to Axum 0.8+ style path parameters.