Crate api_version

Source
Expand description

Axum middleware to rewrite a request such that a version prefix, e.g. "/v0", is added to the path.

Structs§

All
ApiVersionFilter making all requests be rewritten.
ApiVersionLayer
Axum middleware to rewrite a request such that a version prefix is added to the path. This is based on a set of API versions and an optional "x-api-version" custom HTTP header: if no such header is present, the highest version is used. Yet this only applies to requests the URIs of which pass a filter; others are not rewritten.
ApiVersionService
See ApiVersionLayer.
ApiVersions
API versions; a validated newtype for a u16 array.
XApiVersion
Custom HTTP header conveying the API version, which is expected to be a version designator starting with 'v' followed by a number within 0u16..10_000 without leading zero, e.g. v0.

Statics§

X_API_VERSION
Header name for the XApiVersion custom HTTP header.

Traits§

ApiVersionFilter
Filter to determine which requests are rewritten.