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
Request
s andResponse
s from aAsyncRead
er. - write
- Writes HTTP/1
Response
s andRequest
s to aAsyncWrite
.
Structs§
- Read
ToAsync - Helper struct for
read_to_async
.
Functions§
- read_
to_ async - An adaptor between std’s
Read
and tokio’sAsyncRead
traits. This should be used when you have a foreign type which implements read (on aVec
, for example) that returns immediately, because you buffered the actual read with tokio. - read_
to_ end - Reads
reader
to end intobuffer
. Also seeread_to_end_or_max()
. - read_
to_ end_ or_ max - Reads from
reader
tobuffer
until it returns zero bytes ormax_length
is reached.BytesMut::len
is used as a starting length ofbuffer
. Note thatmax_len
is a suggestion and will probably be overran.