Trait sigma_ser::vlq_encode::ReadSigmaVlqExt
source · pub trait ReadSigmaVlqExt: Read {
// Provided methods
fn get_i8(&mut self) -> Result<i8, Error> { ... }
fn get_u8(&mut self) -> Result<u8, Error> { ... }
fn get_i16(&mut self) -> Result<i16, VlqEncodingError> { ... }
fn get_u16(&mut self) -> Result<u16, VlqEncodingError> { ... }
fn get_i32(&mut self) -> Result<i32, VlqEncodingError> { ... }
fn get_u32(&mut self) -> Result<u32, VlqEncodingError> { ... }
fn get_i64(&mut self) -> Result<i64, VlqEncodingError> { ... }
fn get_u64(&mut self) -> Result<u64, VlqEncodingError> { ... }
fn get_bits(&mut self, size: usize) -> Result<Vec<bool>, VlqEncodingError> { ... }
fn get_short_string(&mut self) -> Result<String, VlqEncodingError> { ... }
fn get_option<T>(
&mut self,
get_value: &dyn Fn(&mut Self) -> Result<T, VlqEncodingError>
) -> Option<T> { ... }
}
Expand description
Read and decode values using VLQ (+ ZigZag for signed values) encoded and written with WriteSigmaVlqExt
for VLQ see https://en.wikipedia.org/wiki/Variable-length_quantity (GLE)
for ZigZag see https://developers.google.com/protocol-buffers/docs/encoding#types
Provided Methods§
sourcefn get_i16(&mut self) -> Result<i16, VlqEncodingError>
fn get_i16(&mut self) -> Result<i16, VlqEncodingError>
Read and decode using VLQ and ZigZag value written with WriteSigmaVlqExt::put_i16
sourcefn get_u16(&mut self) -> Result<u16, VlqEncodingError>
fn get_u16(&mut self) -> Result<u16, VlqEncodingError>
Read and decode using VLQ value written with WriteSigmaVlqExt::put_u16
sourcefn get_i32(&mut self) -> Result<i32, VlqEncodingError>
fn get_i32(&mut self) -> Result<i32, VlqEncodingError>
Read and decode using VLQ and ZigZag value written with WriteSigmaVlqExt::put_i32
sourcefn get_u32(&mut self) -> Result<u32, VlqEncodingError>
fn get_u32(&mut self) -> Result<u32, VlqEncodingError>
Read and decode using VLQ value written with WriteSigmaVlqExt::put_u32
sourcefn get_i64(&mut self) -> Result<i64, VlqEncodingError>
fn get_i64(&mut self) -> Result<i64, VlqEncodingError>
Read and decode using VLQ and ZigZag value written with WriteSigmaVlqExt::put_i64
sourcefn get_u64(&mut self) -> Result<u64, VlqEncodingError>
fn get_u64(&mut self) -> Result<u64, VlqEncodingError>
Read and decode using VLQ value written with WriteSigmaVlqExt::put_u64
sourcefn get_bits(&mut self, size: usize) -> Result<Vec<bool>, VlqEncodingError>
fn get_bits(&mut self, size: usize) -> Result<Vec<bool>, VlqEncodingError>
Read a vector of bits with the given size
sourcefn get_short_string(&mut self) -> Result<String, VlqEncodingError>
fn get_short_string(&mut self) -> Result<String, VlqEncodingError>
Reads a string from the reader. Reads a byte (size), and the string
sourcefn get_option<T>(
&mut self,
get_value: &dyn Fn(&mut Self) -> Result<T, VlqEncodingError>
) -> Option<T>
fn get_option<T>( &mut self, get_value: &dyn Fn(&mut Self) -> Result<T, VlqEncodingError> ) -> Option<T>
Read and decode an optional value using supplied function
Object Safety§
Implementors§
impl<R: Read + ?Sized> ReadSigmaVlqExt for R
Mark all types implementing Read
as implementing the extension.