#[repr(transparent)]pub struct VarLong(pub i64);Expand description
An i64 encoded with variable length.
Tuple Fields§
§0: i64Implementations§
Source§impl VarLong
impl VarLong
Sourcepub const MAX_SIZE: usize = 10usize
pub const MAX_SIZE: usize = 10usize
The maximum number of bytes a VarLong can occupy when read from and
written to the Minecraft protocol.
Sourcepub fn written_size(self) -> usize
pub fn written_size(self) -> usize
Returns the exact number of bytes this varlong will write when
Encode::encode is called, assuming no error occurs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VarLong
impl<'de> Deserialize<'de> for VarLong
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 VarLong
impl Ord for VarLong
Source§impl PartialOrd for VarLong
impl PartialOrd for VarLong
impl Copy for VarLong
impl Eq for VarLong
impl StructuralPartialEq for VarLong
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
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.