MCPcopy Index your code
hub / github.com/dermesser/integer-encoding-rs / VarIntReader

Interface VarIntReader

src/reader.rs:16–24  ·  view source on GitHub ↗

A trait for reading [`VarInts`] from any other `Reader`. It's recommended to use a buffered reader, as many small reads will happen.

Source from the content-addressed store, hash-verified

14///
15/// It's recommended to use a buffered reader, as many small reads will happen.
16pub trait VarIntReader {
17 /// Returns either the decoded integer, or an error.
18 ///
19 /// In general, this always reads a whole varint. If the encoded varint's value is bigger
20 /// than the valid value range of `VI`, then the value is truncated.
21 ///
22 /// On EOF, an [`io::Error`] with [`io::ErrorKind::UnexpectedEof`] is returned.
23 fn read_varint<VI: VarInt>(&mut self) -> Result<VI>;
24}
25
26#[cfg(any(feature = "tokio_async", feature = "futures_async"))]
27/// Like a VarIntReader, but returns a future.

Callers

nothing calls this directly

Implementers 1

reader.rssrc/reader.rs

Calls

no outgoing calls

Tested by

no test coverage detected