A buffered wrapper around a reader, reducing the number of read syscalls.
More...
|
| | BufReader (R inner, usize capacity=DEFAULT_BUF_SIZE) |
| | Creates a new BufReader with the specified buffer capacity.
|
| |
|
auto | get_ref () const noexcept -> const R & |
| | Returns a reference to the underlying reader.
|
| |
|
auto | get_mut () noexcept -> R & |
| | Returns a mutable reference to the underlying reader.
|
| |
|
auto | capacity () const noexcept -> usize |
| | Returns the total capacity of the internal buffer.
|
| |
|
auto | buffer () const noexcept -> slice< u8 > |
| | Returns a slice of the buffered data that has been read but not yet consumed.
|
| |
|
void | discard_buffer () noexcept |
| | Discard the internal buffer (call after seeking inner directly).
|
| |
|
auto | into_inner () &&-> R |
| | Unwrap the inner reader (discards any buffered data).
|
| |
template<typename R>
requires Impled<R,
io::Read>
class rstd::io::BufReader< R >
A buffered wrapper around a reader, reducing the number of read syscalls.
- Template Parameters
-
| R | The underlying reader type, which must implement io::Read. |
◆ BufReader()
Creates a new BufReader with the specified buffer capacity.
- Parameters
-
| inner | The underlying reader. |
| capacity | The buffer size in bytes (defaults to DEFAULT_BUF_SIZE). |
The documentation for this class was generated from the following file:
- /home/runner/work/rstd/rstd/src/std/io/buffered.cppm