#[repr(transparent)]pub struct VarInt(pub i32);Expand description
An i32 encoded with variable length.
Tuple Fields§
§0: i32Implementations§
Source§impl VarInt
impl VarInt
Sourcepub const MAX_SIZE: usize = 5usize
pub const MAX_SIZE: usize = 5usize
The maximum number of bytes a VarInt could occupy when read from and
written to the Minecraft protocol.
Sourcepub const fn written_size(self) -> usize
pub const fn written_size(self) -> usize
Returns the exact number of bytes this varint will write when
Encode::encode is called, assuming no error occurs.
pub fn decode_partial<R: Read>(r: R) -> Result<i32, VarIntDecodeError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VarInt
impl<'de> Deserialize<'de> for VarInt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for VarInt
impl Ord for VarInt
Source§impl PartialOrd for VarInt
impl PartialOrd for VarInt
impl Copy for VarInt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.