A trait for reading [`VarInts`] from any other `Reader`. It's recommended to use a buffered reader, as many small reads will happen.
| 14 | /// |
| 15 | /// It's recommended to use a buffered reader, as many small reads will happen. |
| 16 | pub 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. |
nothing calls this directly
no outgoing calls
no test coverage detected