pub trait WriteSigmaVlqExt: Write {
Show 15 methods // Provided methods fn put_i8(&mut self, v: i8) -> Result<()> { ... } fn put_u8(&mut self, v: u8) -> Result<()> { ... } fn put_i16(&mut self, v: i16) -> Result<()> { ... } fn put_u16(&mut self, v: u16) -> Result<()> { ... } fn put_usize_as_u16_unwrapped(&mut self, v: usize) -> Result<()> { ... } fn put_usize_as_u32_unwrapped(&mut self, v: usize) -> Result<()> { ... } fn put_i32(&mut self, v: i32) -> Result<()> { ... } fn put_u32(&mut self, v: u32) -> Result<()> { ... } fn put_u32_be_bytes(&mut self, v: u32) -> Result<()> { ... } fn put_i64(&mut self, v: i64) -> Result<()> { ... } fn put_u64(&mut self, v: u64) -> Result<()> { ... } fn put_bits(&mut self, bools: &[bool]) -> Result<()> { ... } fn put_i16_be_bytes(&mut self, v: i16) -> Result<()> { ... } fn put_short_string(&mut self, s: &str) -> Result<()> { ... } fn put_option<T>( &mut self, opt: Option<T>, put_value: &dyn Fn(&mut Self, T) -> Result<()> ) -> Result<()> { ... }
}
Expand description

Write encoded unsigned values using VLQ and signed values first with ZigZag, then using VLQ 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§

source

fn put_i8(&mut self, v: i8) -> Result<()>

Write i8 without encoding

source

fn put_u8(&mut self, v: u8) -> Result<()>

Write u8 without encoding

source

fn put_i16(&mut self, v: i16) -> Result<()>

Encode using ZigZag and then VLQ.

source

fn put_u16(&mut self, v: u16) -> Result<()>

Encode using VLQ.

source

fn put_usize_as_u16_unwrapped(&mut self, v: usize) -> Result<()>

Cast to u16 (panics if out of range) and encode using VLQ

source

fn put_usize_as_u32_unwrapped(&mut self, v: usize) -> Result<()>

Cast to u32 (panics if out of range) and encode using VLQ

source

fn put_i32(&mut self, v: i32) -> Result<()>

Encode using ZigZag and then VLQ.

source

fn put_u32(&mut self, v: u32) -> Result<()>

Encode using VLQ.

source

fn put_u32_be_bytes(&mut self, v: u32) -> Result<()>

Write bytes of v directly (big-endian format)

source

fn put_i64(&mut self, v: i64) -> Result<()>

Encode using ZigZag and then VLQ.

source

fn put_u64(&mut self, v: u64) -> Result<()>

Encode using VLQ.

source

fn put_bits(&mut self, bools: &[bool]) -> Result<()>

Encode bool array as bit vector, filling trailing bits with false

source

fn put_i16_be_bytes(&mut self, v: i16) -> Result<()>

Put the two bytes of the big-endian representation of the i16 value into the writer.

source

fn put_short_string(&mut self, s: &str) -> Result<()>

Put a short string (< 256 bytes) into the writer. Writes length (as u8) and string bytes to the writer

source

fn put_option<T>( &mut self, opt: Option<T>, put_value: &dyn Fn(&mut Self, T) -> Result<()> ) -> Result<()>

Encode an optional value

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<W: Write + ?Sized> WriteSigmaVlqExt for W

Mark all types implementing Write as implementing the extension.