pub struct VarInt(pub u64);Expand description
Variable-integer encoding.
Integer can be encoded depending on the represented value to save space. Variable length integers always precede an array/vector of a type of data that may vary in length. Longer numbers are encoded in little endian.
| Value | Storage length | Format |
|---|---|---|
| <= 0xfc | 1 | u8 |
| <= 0xffff | 3 | 0xfd followed by value as u16 |
| <= 0xffffffff | 5 | 0xfe followed by value as u32 |
| - | 9 | 0xff followed by value as u64 |
See also Bitcoin variable length integers.
Tuple Fields§
§0: u64Implementations§
Trait Implementations§
impl Eq for VarInt
impl StructuralPartialEq for VarInt
Auto Trait Implementations§
impl Freeze for VarInt
impl RefUnwindSafe for VarInt
impl Send for VarInt
impl Sync for VarInt
impl Unpin for VarInt
impl UnwindSafe for VarInt
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