Struct svbyte::EncodeCursor
source · pub struct EncodeCursor<W> { /* private fields */ }
Expand description
Stream VByte Encoder
Encodes a stream of numbers and saves them in a Write
output stream.
Data format follows this structure:
┌───────┬───────┬─────────┬─────────┬────────┬────────┐
│ MAGIC │ COUNT │ CS SIZE │ DS SIZE │ CS ... │ DS ... │
└───────┴───────┴─────────┴─────────┴────────┴────────┘
MAGIC
is always0x0B0D
;COUNT
the number of elements encoded in the segment (u32
);CS SIZE
is the size of control stream in bytes (u32
);DS SIZE
is the size of data stream in bytes (u32
);CS
andDS
and control and data streams.
Segment header (MAGIC
, COUNT
, CS SIZE
, DS SIZE
) is enough to calculate the whole segment size.
Segments follows each other until EOF of a stream reached.
Implementations§
Auto Trait Implementations§
impl<W> RefUnwindSafe for EncodeCursor<W>where W: RefUnwindSafe,
impl<W> Send for EncodeCursor<W>where W: Send,
impl<W> Sync for EncodeCursor<W>where W: Sync,
impl<W> Unpin for EncodeCursor<W>
impl<W> UnwindSafe for EncodeCursor<W>where W: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more