Trait bin_prot::ReadBinProtExt
source · [−]pub trait ReadBinProtExt: Read {
fn bin_read_unit(&mut self) -> Result<()> { ... }
fn bin_read_bool(&mut self) -> Result<bool> { ... }
fn bin_read_char(&mut self) -> Result<char> { ... }
fn bin_read_integer<T: FromPrimitive>(&mut self) -> Result<T> { ... }
fn bin_read_nat0<T: FromPrimitive + Unsigned>(&mut self) -> Result<T> { ... }
fn bin_read_variant_index(&mut self) -> Result<u8> { ... }
fn bin_read_polyvar_tag(&mut self) -> Result<u32> { ... }
fn bin_read_string(&mut self) -> Result<String> { ... }
fn bin_read_bytes(&mut self) -> Result<Vec<u8>> { ... }
}
Expand description
Extension trait for readers implementing io::Read to allow them to read a bin_prot encoded values
Provided Methods
sourcefn bin_read_unit(&mut self) -> Result<()>
fn bin_read_unit(&mut self) -> Result<()>
Read a unit
sourcefn bin_read_bool(&mut self) -> Result<bool>
fn bin_read_bool(&mut self) -> Result<bool>
Read a bool
sourcefn bin_read_char(&mut self) -> Result<char>
fn bin_read_char(&mut self) -> Result<char>
Read a single byte as char
sourcefn bin_read_integer<T: FromPrimitive>(&mut self) -> Result<T>
fn bin_read_integer<T: FromPrimitive>(&mut self) -> Result<T>
Read a variable length integer
sourcefn bin_read_nat0<T: FromPrimitive + Unsigned>(&mut self) -> Result<T>
fn bin_read_nat0<T: FromPrimitive + Unsigned>(&mut self) -> Result<T>
Read a variable length natural integer
sourcefn bin_read_variant_index(&mut self) -> Result<u8>
fn bin_read_variant_index(&mut self) -> Result<u8>
Read the index of a variant
sourcefn bin_read_polyvar_tag(&mut self) -> Result<u32>
fn bin_read_polyvar_tag(&mut self) -> Result<u32>
Read the tag of a polyvar variant (4 bytes) You can convert between ocaml native integer using (x << 1 | 1)
sourcefn bin_read_string(&mut self) -> Result<String>
fn bin_read_string(&mut self) -> Result<String>
Read a string
sourcefn bin_read_bytes(&mut self) -> Result<Vec<u8>>
fn bin_read_bytes(&mut self) -> Result<Vec<u8>>
read some bytes
Implementors
impl<W: Read + ?Sized> ReadBinProtExt for W
All types that implement Read
get methods defined in ReadBinProtIntegerExt
for free.