Struct quick_protobuf::reader::Reader [] [src]

pub struct Reader<R> { /* fields omitted */ }

A struct to read protocol binary files

Methods

impl<R: Read> Reader<R>
[src]

Creates a new protocol buffer reader with the maximum len of bytes to read

Reads next tag, None if all bytes have been read

Reads int32 (varint)

Reads int64 (varint)

Reads uint32 (varint)

Reads uint64 (varint)

Reads sint32 (varint)

Reads sint64 (varint)

Reads fixed64 (little endian u64)

Reads fixed32 (little endian u32)

Reads sfixed64 (little endian i64)

Reads sfixed32 (little endian i32)

Reads float (little endian f32)

Reads double (little endian f64)

Reads bool (varint, check if == 0)

Reads enum, encoded as i32

Reads bytes (Vec)

Reads string (String)

Reads packed repeated field (Vec)

Note: packed field are stored as a variable length chunk of data, while regular repeated fields behaves like an iterator, yielding their tag everytime

Reads a nested message

Reads unknown data, based on its tag value (which itself gives us the wire_type value)

Gets the remaining length of bytes not read yet

Gets the inner reader

Checks if self.len == 0