Expand description
§hyper_middleware
hyper_middleware
is a complement set of HTTP middlewares with a small Hyper Service to get started with a HTTP server easily.
This module only supports Hyper 0.14
.
§Features
- Compact Middleware & Handler System inspired by The Iron Framework.
- Simple Hyper Service with Remote Address access.
- Convenient
Error
andResult
types powered by anyhow. Async
support via async-trait.- Macros to facilitate HTTP response errors or error casting.
Check it out middleware
module for more details.
Re-exports§
pub use error::Error;
pub use error::Result;
pub use http::*;
pub use middleware::*;
pub use remote_addr::*;
pub use service::*;
Modules§
- error
- The custom error module.
- http
- Set of HTTP types aliases for convenience.
- middleware
- The middleware and handler system module.
- remote_
addr - Module representing the remote (peer) address of a connection.
- service
- The Hyper service module.
Macros§
- bail
- Constructs an
Error
with the given arguments and returns early with anErr
result. - error
- Constructs an
Error
with the given arguments. - http_
error_ bad_ gateway - Constructs an
Error
withhyper::StatusCode::BAD_GATEWAY
from a string or existing non-anyhow error value. - http_
error_ bad_ request - Constructs an
Error
withhyper::StatusCode::BAD_REQUEST
from a string or existing non-anyhow error value. - http_
error_ conflict - Constructs an
Error
withhyper::StatusCode::CONFLICT
from a string or existing non-anyhow error value. - http_
error_ expectation_ failed - Constructs an
Error
withhyper::StatusCode::EXPECTATION_FAILED
from a string or existing non-anyhow error value. - http_
error_ forbidden - Constructs an
Error
withhyper::StatusCode::FORBIDDEN
from a string or existing non-anyhow error value. - http_
error_ gateway_ timeout - Constructs an
Error
withhyper::StatusCode::GATEWAY_TIMEOUT
from a string or existing non-anyhow error value. - http_
error_ gone - Constructs an
Error
withhyper::StatusCode::GONE
from a string or existing non-anyhow error value. - http_
error_ http_ version_ not_ supported - Constructs an
Error
withhyper::StatusCode::HTTP_VERSION_NOT_SUPPORTED
from a string or existing non-anyhow error value. - http_
error_ insufficient_ storage - Constructs an
Error
withhyper::StatusCode::INSUFFICIENT_STORAGE
from a string or existing non-anyhow error value. - http_
error_ internal_ server_ error - Constructs an
Error
withhyper::StatusCode::INTERNAL_SERVER_ERROR
from a string or existing non-anyhow error value. - http_
error_ length_ required - Constructs an
Error
withhyper::StatusCode::LENGTH_REQUIRED
from a string or existing non-anyhow error value. - http_
error_ loop_ detected - Constructs an
Error
withhyper::StatusCode::LOOP_DETECTED
from a string or existing non-anyhow error value. - http_
error_ method_ not_ allowed - Constructs an
Error
withhyper::StatusCode::METHOD_NOT_ALLOWED
from a string or existing non-anyhow error value. - http_
error_ not_ acceptable - Constructs an
Error
withhyper::StatusCode::NOT_ACCEPTABLE
from a string or existing non-anyhow error value. - http_
error_ not_ found - Constructs an
Error
withhyper::StatusCode::NOT_FOUND
from a string or existing non-anyhow error value. - http_
error_ not_ implemented - Constructs an
Error
withhyper::StatusCode::NOT_IMPLEMENTED
from a string or existing non-anyhow error value. - http_
error_ payload_ too_ large - Constructs an
Error
withhyper::StatusCode::PAYLOAD_TOO_LARGE
from a string or existing non-anyhow error value. - http_
error_ payment_ required - Constructs an
Error
withhyper::StatusCode::PAYMENT_REQUIRED
from a string or existing non-anyhow error value. - http_
error_ precondition_ failed - Constructs an
Error
withhyper::StatusCode::PRECONDITION_FAILED
from a string or existing non-anyhow error value. - http_
error_ proxy_ authentication_ required - Constructs an
Error
withhyper::StatusCode::PROXY_AUTHENTICATION_REQUIRED
from a string or existing non-anyhow error value. - http_
error_ range_ not_ satisfiable - Constructs an
Error
withhyper::StatusCode::RANGE_NOT_SATISFIABLE
from a string or existing non-anyhow error value. - http_
error_ request_ timeout - Constructs an
Error
withhyper::StatusCode::REQUEST_TIMEOUT
from a string or existing non-anyhow error value. - http_
error_ service_ unavailable - Constructs an
Error
withhyper::StatusCode::SERVICE_UNAVAILABLE
from a string or existing non-anyhow error value. - http_
error_ unauthorized - Constructs an
Error
withhyper::StatusCode::UNAUTHORIZED
from a string or existing non-anyhow error value. - http_
error_ unsupported_ media_ type - Constructs an
Error
withhyper::StatusCode::UNSUPPORTED_MEDIA_TYPE
from a string or existing non-anyhow error value. - http_
error_ uri_ too_ long - Constructs an
Error
withhyper::StatusCode::URI_TOO_LONG
from a string or existing non-anyhow error value. - http_
error_ variant_ also_ negotiates - Constructs an
Error
withhyper::StatusCode::VARIANT_ALSO_NEGOTIATES
from a string or existing non-anyhow error value.
Traits§
- Context
- Provides the
context
method forResult
.