Expand description
Size-capped reads of streams whose length the caller does not control.
Each reader takes at most max + 1 bytes from the stream: one byte past the
cap is enough to tell a stream of exactly max bytes from a longer one.
None means more than max bytes were available. How that is reported is
left to the caller, so each call site keeps its own error.
Functionsยง
- read_
to_ end_ bounded - Read
readerto its end.Someholds every byte when the stream has at mostmaxbytes,Nonemeans it had more, and a read error is returned unchanged. - read_
to_ end_ bounded_ async - Async counterpart of
read_to_end_boundedover atokioreader.