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
ErrorandResulttypes powered by anyhow. Asyncsupport 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
Errorwith the given arguments and returns early with anErrresult. - error
- Constructs an
Errorwith the given arguments. - http_
error_ bad_ gateway - Constructs an
Errorwithhyper::StatusCode::BAD_GATEWAYfrom a string or existing non-anyhow error value. - http_
error_ bad_ request - Constructs an
Errorwithhyper::StatusCode::BAD_REQUESTfrom a string or existing non-anyhow error value. - http_
error_ conflict - Constructs an
Errorwithhyper::StatusCode::CONFLICTfrom a string or existing non-anyhow error value. - http_
error_ expectation_ failed - Constructs an
Errorwithhyper::StatusCode::EXPECTATION_FAILEDfrom a string or existing non-anyhow error value. - http_
error_ forbidden - Constructs an
Errorwithhyper::StatusCode::FORBIDDENfrom a string or existing non-anyhow error value. - http_
error_ gateway_ timeout - Constructs an
Errorwithhyper::StatusCode::GATEWAY_TIMEOUTfrom a string or existing non-anyhow error value. - http_
error_ gone - Constructs an
Errorwithhyper::StatusCode::GONEfrom a string or existing non-anyhow error value. - http_
error_ http_ version_ not_ supported - Constructs an
Errorwithhyper::StatusCode::HTTP_VERSION_NOT_SUPPORTEDfrom a string or existing non-anyhow error value. - http_
error_ insufficient_ storage - Constructs an
Errorwithhyper::StatusCode::INSUFFICIENT_STORAGEfrom a string or existing non-anyhow error value. - http_
error_ internal_ server_ error - Constructs an
Errorwithhyper::StatusCode::INTERNAL_SERVER_ERRORfrom a string or existing non-anyhow error value. - http_
error_ length_ required - Constructs an
Errorwithhyper::StatusCode::LENGTH_REQUIREDfrom a string or existing non-anyhow error value. - http_
error_ loop_ detected - Constructs an
Errorwithhyper::StatusCode::LOOP_DETECTEDfrom a string or existing non-anyhow error value. - http_
error_ method_ not_ allowed - Constructs an
Errorwithhyper::StatusCode::METHOD_NOT_ALLOWEDfrom a string or existing non-anyhow error value. - http_
error_ not_ acceptable - Constructs an
Errorwithhyper::StatusCode::NOT_ACCEPTABLEfrom a string or existing non-anyhow error value. - http_
error_ not_ found - Constructs an
Errorwithhyper::StatusCode::NOT_FOUNDfrom a string or existing non-anyhow error value. - http_
error_ not_ implemented - Constructs an
Errorwithhyper::StatusCode::NOT_IMPLEMENTEDfrom a string or existing non-anyhow error value. - http_
error_ payload_ too_ large - Constructs an
Errorwithhyper::StatusCode::PAYLOAD_TOO_LARGEfrom a string or existing non-anyhow error value. - http_
error_ payment_ required - Constructs an
Errorwithhyper::StatusCode::PAYMENT_REQUIREDfrom a string or existing non-anyhow error value. - http_
error_ precondition_ failed - Constructs an
Errorwithhyper::StatusCode::PRECONDITION_FAILEDfrom a string or existing non-anyhow error value. - http_
error_ proxy_ authentication_ required - Constructs an
Errorwithhyper::StatusCode::PROXY_AUTHENTICATION_REQUIREDfrom a string or existing non-anyhow error value. - http_
error_ range_ not_ satisfiable - Constructs an
Errorwithhyper::StatusCode::RANGE_NOT_SATISFIABLEfrom a string or existing non-anyhow error value. - http_
error_ request_ timeout - Constructs an
Errorwithhyper::StatusCode::REQUEST_TIMEOUTfrom a string or existing non-anyhow error value. - http_
error_ service_ unavailable - Constructs an
Errorwithhyper::StatusCode::SERVICE_UNAVAILABLEfrom a string or existing non-anyhow error value. - http_
error_ unauthorized - Constructs an
Errorwithhyper::StatusCode::UNAUTHORIZEDfrom a string or existing non-anyhow error value. - http_
error_ unsupported_ media_ type - Constructs an
Errorwithhyper::StatusCode::UNSUPPORTED_MEDIA_TYPEfrom a string or existing non-anyhow error value. - http_
error_ uri_ too_ long - Constructs an
Errorwithhyper::StatusCode::URI_TOO_LONGfrom a string or existing non-anyhow error value. - http_
error_ variant_ also_ negotiates - Constructs an
Errorwithhyper::StatusCode::VARIANT_ALSO_NEGOTIATESfrom a string or existing non-anyhow error value.
Traits§
- Context
- Provides the
contextmethod forResult.