Expand description
Error types and utilities.
This module provides the core error handling infrastructure. The main types are:
Error- The main error type used throughout HTTP operationsResult- A specialized Result type alias for HTTP operationsResultExt- Extension trait that adds HTTP status code handling
The error types integrate with standard Rust error handling while adding HTTP-specific functionality like status codes.
§Examples
use http_kit::{Error, Result, ResultExt};
use http::StatusCode;
// Create an error with a status code
let err = Error::msg("not found").set_status(StatusCode::NOT_FOUND);
// Add status code to existing Result
let result: Result<()> = Ok::<(), std::convert::Infallible>(()).status(StatusCode::OK);Structs§
- Error
- A concrete error type for HTTP operations.
Traits§
- Http
Error - Trait for errors that have an associated HTTP status code.
- Result
Ext - Extension trait for adding status codes to Results.
Type Aliases§
- BoxHttp
Error - A boxed HTTP error trait object.
- Result
- A specialized Result type for HTTP operations.