File: Read_BitVec.md

package info (click to toggle)
rust-bitvec 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,780 kB
  • sloc: makefile: 2
file content (14 lines) | stat: -rw-r--r-- 547 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Reading From a Bit-Vector

The implementation loads bytes out of the reference bit-vector until either the
destination buffer is filled or the source has no more bytes to provide. When
`.read()` returns, the provided bit-vector will have its contents shifted down
so that it begins at the first bit *after* the last byte copied out into `buf`.

Note that the return value of `.read()` is always the number of *bytes* of `buf`
filled!

## API Differences

The standard library does not `impl Read for Vec<u8>`. It is provided here as a
courtesy.