Struct binary_util::types::varu32
source · pub struct varu32(pub u32);
Expand description
A variable length integer type that can be up to 32 bits.
This is a helper type for deriving the BinaryIo
trait.
You should not use this type directly, if you are reading or writing
a variable length integer, use the ByteWriter
or ByteReader
and use
the corresponding read_var_u32
or write_var_u32
methods.
Tuple Fields§
§0: u32
Implementations§
Methods from Deref<Target = u32>§
pub const MIN: u32 = 0u32
pub const MAX: u32 = 4_294_967_295u32
pub const BITS: u32 = 32u32
Trait Implementations§
source§impl Ord for varu32
impl Ord for varu32
source§impl PartialEq<varu32> for varu32
impl PartialEq<varu32> for varu32
source§impl PartialOrd<varu32> for varu32
impl PartialOrd<varu32> for varu32
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Writer for varu32
impl Writer for varu32
source§fn write_to_bytes(&self) -> Result<ByteWriter, Error>
fn write_to_bytes(&self) -> Result<ByteWriter, Error>
This is a utility function to write
Self
to a ByteWriter
without
needing to create a ByteWriter
first.impl Copy for varu32
impl Eq for varu32
impl StructuralEq for varu32
impl StructuralPartialEq for varu32
Auto Trait Implementations§
impl RefUnwindSafe for varu32
impl Send for varu32
impl Sync for varu32
impl Unpin for varu32
impl UnwindSafe for varu32
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