Crate kvarn_async

Source
Expand description

Async bits for web applications.

This includes reading to bytes, a adapter between std’s Read trait and tokio’s AsyncRead, a write module for writing HTTP/1 requests and responses, and a read module for reading HTTP/1 requests and responses.

Modules§

prelude
Prelude for async utilities for use in web applications.
read
Reads HTTP/1 Requests and Responses from a AsyncReader.
write
Writes HTTP/1 Responses and Requests to a AsyncWrite.

Structs§

ReadToAsync
Helper struct for read_to_async.

Functions§

read_to_async
An adaptor between std’s Read and tokio’s AsyncRead traits. This should be used when you have a foreign type which implements read (on a Vec, for example) that returns immediately, because you buffered the actual read with tokio.
read_to_end
Reads reader to end into buffer. Also see read_to_end_or_max().
read_to_end_or_max
Reads from reader to buffer until it returns zero bytes or max_length is reached. BytesMut::len is used as a starting length of buffer. Note that max_len is a suggestion and will probably be overran.