File: README

package info (click to toggle)
hare 0.25.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,948 kB
  • sloc: asm: 1,264; makefile: 123; sh: 114; lisp: 101
file content (16 lines) | stat: -rw-r--r-- 834 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
bufio: buffered I/O primitives

bufio provides an [[io::stream]] implementation which provides buffered I/O
support, utility functions which pair well with buffered streams, and a
[[scanner]] type which allocates and maintains its own read buffer.

A buffered [[stream]] is used to batch read and write operations against an
underlying [[io::handle]]. bufio provides several utilities for reading from
handles, namely [[read_tok]] et al. These functions require small, frequent
reads, or take advantage of look-ahead, and thus are most efficient when paired
with a buffered [[stream]].

bufio also provides a "scanning" interface, with functions like [[scan_string]]
which take in a [[scanner]]. Strings returned from scanning functions are
borrowed from the scanner's read buffer, so allocated memory can be reused for
future scans.