Type Alias Result
type Result = std::result::Result<T, E>
An IntoResponse-based result type that uses ErrorResponse as the error type.
All types which implement IntoResponse can be converted to an ErrorResponse. This makes
it useful as a general purpose error type for functions which combine multiple distinct error
types that all implement IntoResponse.
Example
use ;
// two fallible functions with different error types
// each error type implements `IntoResponse`
;
// we can combine them using `axum::response::Result` and still use `?`
async
As a replacement for std::result::Result
Since axum::response::Result has a default error type you only have to specify the Ok type:
use ;
// `Result<T>` automatically uses `ErrorResponse` as the error type.
async
// You can still specify the error even if you've imported `axum::response::Result`