Struct hebo_codec::VarInt
source · [−]pub struct VarInt(_);Expand description
The Variable Byte Integer is encoded using an encoding scheme which uses a single byte for values up to 127.
Larger values are handled as follows. The least significant seven bits of each byte encode the data, and the most significant bit is used to indicate whether there are bytes following in the representation. Thus, each byte encodes 128 values and a “continuation bit”. The maximum number of bytes in the Variable Byte Integer field is four. The encoded value MUST use the minimum number of bytes necessary to represent the value [MQTT-1.5.5-1].
Implementations
sourceimpl VarInt
impl VarInt
sourcepub const fn from(len: usize) -> Result<Self, VarIntError>
pub const fn from(len: usize) -> Result<Self, VarIntError>
pub fn unchecked_add(&mut self, v: usize)
pub fn unchecked_sub(&mut self, v: usize)
Trait Implementations
sourceimpl DecodePacket for VarInt
impl DecodePacket for VarInt
sourceimpl EncodePacket for VarInt
impl EncodePacket for VarInt
impl Copy for VarInt
impl Eq for VarInt
impl StructuralEq for VarInt
impl StructuralPartialEq for VarInt
Auto Trait Implementations
impl RefUnwindSafe for VarInt
impl Send for VarInt
impl Sync for VarInt
impl Unpin for VarInt
impl UnwindSafe for VarInt
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more