[−][src]Crate body_image_futio
Asynchronous HTTP integration for body-image.
The body-image-futio crate integrates the body-image crate with futures, http, hyper 0.12.x., and tokio crates for both client and server use.
-
Trait
RequestRecorderextendshttp::request::Builderfor recording aRequestRecordof varous body types, which can then be passed torequest_dialogorfetch. -
The
fetchfunction runs aRequestRecordand returns a completedDialogusing a single-use client and runtime forrequest_dialog. -
The
request_dialogfunction returns aFuture<Item=Dialog>, given a suitablehyper::Clientreference andRequestRecord. This function is thus more composable for complete tokio applications. -
AsyncBodySinkadapts aBodySinkfor asynchronous input from a (e.g.hyper::Body)Stream. -
AsyncBodyImageadapts aBodyImagefor asynchronous output as aStreamandhyper::body::Payload. -
Alternatively,
UniBodySinkandUniBodyImageoffer zero-copyMemMapsupport, using the customUniBodyBufitem buffer type (instead of thehyper::ChunkorBytes). -
The
decode_res_bodyand associated functions will decompress any supported Transfer/Content-Encoding of the response body and update theDialogaccordingly.
Structs
| AsyncBodyImage | Adaptor for |
| AsyncBodySink | Adaptor for |
| RequestRecord | An |
| UniBodyBuf | Provides zero-copy read access to both |
| UniBodyImage | Adaptor for |
| UniBodySink | Adaptor for |
Enums
| FutioError | Error enumeration for body-image-futio origin errors. This may be extended in the future so exhaustive matching is gently discouraged with an unused variant. |
Statics
| ACCEPT_ENCODINGS | Appropriate value for the HTTP accept-encoding request header, including (br)otli when the brotli feature is configured. |
| BROWSE_ACCEPT | A browser-like HTTP accept request header value, with preference for hypertext. |
| VERSION | The crate version string. |
Traits
| RequestRecorder | Extension trait for |
Functions
| decode_res_body | Decode the response body of the provided |
| fetch | Run an HTTP request to completion, returning the full |
| find_chunked | Return true if the chunked Transfer-Encoding can be found in the headers. |
| find_encodings | Return a list of relevant encodings from the headers Transfer-Encoding and
Content-Encoding. The |
| request_dialog | Given a suitable |
| user_agent | Return a generic HTTP user-agent header value for the crate, with version |
Type Definitions
| Flaw | Conveniently compact type alias for dyn Trait |