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 andResponses from aAsyncReader. - write
- Writes HTTP/1
Responses andRequests to aAsyncWrite.
Structs§
- Read
ToAsync - Helper struct for
read_to_async.
Functions§
- read_
to_ async - An adaptor between std’s
Readand tokio’sAsyncReadtraits. 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
readerto end intobuffer. Also seeread_to_end_or_max(). - read_
to_ end_ or_ max - Reads from
readertobufferuntil it returns zero bytes ormax_lengthis reached.BytesMut::lenis used as a starting length ofbuffer. Note thatmax_lenis a suggestion and will probably be overran.