Module error

Module error 

Source
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 operations
  • Result - A specialized Result type alias for HTTP operations
  • ResultExt - 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§

HttpError
Trait for errors that have an associated HTTP status code.
ResultExt
Extension trait for adding status codes to Results.

Type Aliases§

BoxHttpError
A boxed HTTP error trait object.
Result
A specialized Result type for HTTP operations.