Crate api_version

Source

Re-exports§

pub use array_macro;

Macros§

api_version
Create an ApiVersionLayer correctly initialized with non-empty and strictly monotonically increasing versions in the given inclusive range.

Structs§

All
ApiVersionFilter making all requests be rewritten.
ApiVersion
See ApiVersionLayer.
ApiVersionLayer
Axum middleware to rewrite a request such that a version prefix is added to the path. This is based on a set of 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.
XApiVersion
Custom HTTP header conveying the API version, which is expected to be a version designator starting with 'v' followed by a number from 0..+99 without leading zero, e.g. v0.

Enums§

NewApiVersionLayerError
Error creating an ApiVersionLayer.

Statics§

X_API_VERSION
Header name for the XApiVersion custom HTTP header.

Traits§

ApiVersionFilter
Determine which requests are rewritten.