pub struct VarInt(/* private fields */);Expand description
A wrapper struct for a signed 32-bit value, typically used for implementing DataReader and DataWriter.
But the writen size of this type can vary based on the size of the data.
Variable-length format such that smaller numbers use fewer bytes. The 7 least significant bits are used to encode the value and the most significant bit indicates whether there’s another byte after it for the next part of the number. The least significant group is written first, followed by each of the more significant groups; thus, VarInts are effectively little endian (however, groups are 7 bits, not 8).
VarInts are never longer than 5 bytes
Trait Implementations§
source§impl ImportantFunctions for VarInt
impl ImportantFunctions for VarInt
§type ReturnType = <VarInt as ImportantFunctions>::InputType
type ReturnType = <VarInt as ImportantFunctions>::InputType
The type returned by
get_valuesource§fn get_value(&self) -> Self::ReturnType
fn get_value(&self) -> Self::ReturnType
A function that returns the hold data
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