pub struct VarLong { /* private fields */ }
Expand description
Represents a Java Long (i64) using between 1-10 bytes.
Implementations§
Source§impl VarLong
impl VarLong
Sourcepub fn from_bytes(data: &[u8]) -> Result<(VarLong, usize), Error>
pub fn from_bytes(data: &[u8]) -> Result<(VarLong, usize), Error>
Creates a VarLong from a series of bytes. Returns the value and the amount of bytes used if creation is successful.
Sourcepub fn from_reader<R: Read>(reader: &mut R) -> Result<VarLong, Error>
pub fn from_reader<R: Read>(reader: &mut R) -> Result<VarLong, Error>
Creates a VarLong from a reader containing bytes.
Sourcepub fn to_writer<W: Write>(&mut self, writer: &mut W) -> Result<(), Error>
pub fn to_writer<W: Write>(&mut self, writer: &mut W) -> Result<(), Error>
Writes a VarLong to a writer as a series of bytes.
pub fn read_size(&self) -> Option<u8>
Trait Implementations§
impl Copy for VarLong
impl Eq 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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.