Skip to main content

Crate core

Crate core 

Available on crate features http-backend and http and std only.
Expand description

Rama http protocol implementation and low level utilities.

§Cancel safety

Futures returned by this crate’s senders are cancel safe: dropping a future before it completes is the supported way to cancel the operation. The protocol in use changes what that cancellation actually does on the wire:

  • HTTP/1 has no in-protocol way to abort a single request without affecting the shared connection, so dropping an in-flight request future closes the underlying TCP connection. Any subsequent call on the same SendRequest returns a canceled error; the connection cannot be reused.
  • HTTP/2 resets the single stream with RST_STREAM (CANCEL error code) and notifies the peer immediately rather than continuing to deliver a response body that would be discarded. The shared connection stays usable for other in-flight and future requests.

See the documentation on individual futures — for example SendRequest::send_request in client::conn::http1 and the equivalent in client::conn::http2 — for the protocol-specific behavior on cancellation.

§Rama

Crate used by the end-user rama crate and rama crate authors alike.

Learn more about rama:

§rama-http-core

§Features

  • HTTP/1 and HTTP/2
  • Asynchronous design
  • Leading in performance
  • Tested and correct
  • Extensive production use
  • Client and Server APIs

Modules§

body
Streaming bodies for Requests and Responses.
client
HTTP Client.
h2
An asynchronous, HTTP/2 server and client implementation.
server
HTTP Server.
service

Structs§

Error
Represents errors that can occur handling HTTP streams.

Type Aliases§

Result
Result type often returned from methods that can have hyper Errors.