Skip to main content

Crate axum_error_sets

Crate axum_error_sets 

Source
Expand description

Typed, composable HTTP error sets for Axum.

§Overview

  • All status-codes are defined in codes.
  • ApiResponse can be used as the return/error type in an axum handlers.
  • ApiResponse<Tuple> can be used to specify multiple type-safe response types for an axum handler.
  • Provides convenient methods for error propagation through ResultStatusExt.
  • Supports automatic openapi generation through aide or [utoipa].

Modules§

codes
Defines all HTTP status code wrappers.

Structs§

ApiResponse
A response that may be returned from an axum handler, with a flexible set of response types.

Traits§

ApiResultExt
Extension trait for Result types with ApiResponse errors, providing a method to convert the error type into a superset error type.
ResultStatusExt
Extension trait for Result that provides methods to wrap errors with specific HTTP status codes.
StatusProvider
A StatusCode that wraps an inner value, and can thus be used for easy error propagation while keeping track of the status-code in the type-system.

Type Aliases§

ApiResult
A convenient alias for a Result type where the error is an ApiResponse.