pub struct BufReader<R> { /* private fields */ }
Expand description

BufReader is a struct with a buffer. BufReader implements AsyncBufRead and AsyncReadRent, and if the inner io implements AsyncWriteRent, it will delegate the implementation.

Implementations

Create BufReader with default buffer size

Create BufReader with given buffer size

Gets a reference to the underlying reader.

It is inadvisable to directly read from the underlying reader.

Gets a mutable reference to the underlying reader.

Consumes this BufReader, returning the underlying reader.

Note that any leftover data in the internal buffer is lost.

Returns a reference to the internally buffered data.

Unlike fill_buf, this will not attempt to fill the buffer if it is empty.

Trait Implementations

The returned future of fill_buf
Try read data and get a reference to the internal buffer
Mark how much data is read
The future of read Result<size, buffer>
The future of readv Result<size, buffer>
Same as read(2)
Same as readv(2)
The future of write Result<size, buffer>
The future of writev Result<size, buffer>
The future of flush
The future of shutdown
Same as write(2)
Same as writev(2)
Flush buffered data if needed
Same as shutdown

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.