Struct opentimestamps::ser::Deserializer
[−]
[src]
pub struct Deserializer<R: Read> { /* fields omitted */ }
Standard deserializer for OTS info files
Methods
impl<R: Read> Deserializer<R>
[src]
fn new(reader: R) -> Deserializer<R>
Constructs a new deserializer from a reader
fn into_inner(self) -> R
Extracts the underlying reader from the deserializer
fn read_magic(&mut self) -> Result<(), Error>
Reads the magic bytes and checks that they are what we expect
fn read_version(&mut self) -> Result<(), Error>
Reads the version and checks that it is what we expect
fn read_byte(&mut self) -> Result<u8, Error>
Reads a single byte from the reader
fn read_uint(&mut self) -> Result<usize, Error>
Deserializes an unsigned integer
fn read_fixed_bytes(&mut self, n: usize) -> Result<Vec<u8>, Error>
Deserializes a fixed number of bytes
fn read_bytes(&mut self, min: usize, max: usize) -> Result<Vec<u8>, Error>
Deserializes a variable number of bytes
fn check_eof(&mut self) -> Result<(), Error>
Check that there is no trailing data