Crate http_bytes

Source
Expand description

Some ways to define this crate:

  • Adaptor between httparse and http crates.
  • Super-lowlevel web framework, almost minimal one around http crate.
  • A way to make bytes to/from HTTP request/responses

HTTP 1 only, no HTTP 2.

Body is not touched in any way. Not performance-optimized. Request handling code tries to to Basic Authorization (can opt out).

Supports Rust 1.28.0

Re-exports§

pub extern crate http;

Enums§

Error
Error handling for this crate

Constants§

EMPTY_HEADER
An empty header, useful for constructing a Header array to pass in for parsing.

Functions§

parse_request_header
Parse this byte buffer into a Request plus remaining trailing bytes.
parse_request_header_easy
Parse this byte buffer into a Request plus remaining trailing bytes. Returns Ok(None) if not enough bytes yet to produce a complete request. Allocates a space for 50 headers (about 800 bytes) in stack each time.
parse_response_header
Parse this byte buffer into a Response plus remaining trailing bytes.
parse_response_header_easy
Parse this byte buffer into a Response plus remaining trailing bytes. Returns Ok(None) if not enough bytes yet to produce a complete response. Allocates a space for 50 headers (about 800 bytes) in stack each time.
request_header_to_vec
Easy version of write_request_header. See its doc for details Panics on problems
response_header_to_vec
Easy version of write_response_header. See its doc for details Panics on problems
write_request_header
Write request line and headers (but not body) of this HTTP 1.1 request May add ‘Host:’ header automatically Returns number of bytes written
write_response_header
Write response line and headers (but not body) of this HTTP 1.1 response

Type Aliases§

Request
http’s request variant as used by the parser part of this crate.
Response
http’s response variant as used by the parser part of this crate.