pub struct VarLong(/* private fields */);Expand description
A wrapper struct for a signed 64-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, VarLongs are effectively little endian (however, groups are 7 bits, not 8).
VarLongs are never longer than 10 bytes
Trait Implementations§
source§impl ImportantFunctions for VarLong
impl ImportantFunctions for VarLong
§type ReturnType = <VarLong as ImportantFunctions>::InputType
type ReturnType = <VarLong 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 VarLong
impl RefUnwindSafe for VarLong
impl Send for VarLong
impl Sync for VarLong
impl Unpin for VarLong
impl UnwindSafe for VarLong
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