Skip to main content

Crate capy_http

Crate capy_http 

Source
Expand description

Thin Axum routing and response conveniences.

Re-exports§

pub use schemars as schema;

Structs§

ApiDocument
Standard OpenAPI 3.1 document. Advanced applications can customize its JSON.
ApiRouteInfo
Public metadata displayed by capy routes --api.
Created
A JSON response with HTTP 201 Created.
HealthResponse
JSON wire data for process liveness.
Json
Deserialize or return JSON, using Capy’s safe rejection envelope. Put this extractor last because it consumes the body. Native extraction is available as capy::axum::Json.
NoContent
An empty response with HTTP 204 No Content.
Page
A bounded collection response. The caller supplies a paginated query’s rows.
PageMeta
Conventional pagination metadata. Empty collections have one empty page.
Pagination
Validated, one-based page parameters. Use Query<Pagination> in a handler. Defaults to page 1 and 20 items; page size must be 1..=100.
Path
Deserialize path parameters with safe Capy JSON rejections. Native extraction remains available as capy::axum::extract::Path.
Query
Deserialize a query string with safe Capy JSON rejections. Native extraction remains available as capy::axum::extract::Query.
RouteInfo
A declared route, used by capy routes without connecting to a database.
Routes
A native Axum router together with a small, explicit route inventory.

Traits§

ApiSchema
A type which can be described as a JSON Schema document.

Functions§

health
The default health response; it deliberately performs no database query.

Type Aliases§

Paginated
JSON contract name for the existing bounded collection response.
PaginationMeta
JSON contract name for the existing pagination metadata.

Derive Macros§

ApiSchema
Derive macro for JsonSchema trait.