Enum var_num::inner::VarUInt

source ·
pub enum VarUInt {
    U8(u8),
    U16(u16),
    U32(u32),
    U64(u64),
    U128(u128),
}

Variants§

§

U8(u8)

§

U16(u16)

§

U32(u32)

§

U64(u64)

§

U128(u128)

Implementations§

source§

impl VarUInt

source

pub fn to_int(&self) -> VarInt

source

pub fn to_float(&self) -> VarFloat

source§

impl VarUInt

source

pub fn upgrade(&self) -> Self

source

pub fn downgrade(&self) -> Self

source

pub fn to_bytes(&self) -> Vec<u8>

source

pub fn from_bytes(raw: Vec<u8>) -> Self

source

pub fn normalize(lhs: Self, rhs: Self) -> (Self, Self)

Trait Implementations§

source§

impl Add for VarUInt

§

type Output = VarUInt

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign for VarUInt

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl Binary for VarUInt

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl BitAnd for VarUInt

§

type Output = VarUInt

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
source§

impl BitAndAssign for VarUInt

source§

fn bitand_assign(&mut self, other: Self)

Performs the &= operation. Read more
source§

impl BitOr for VarUInt

§

type Output = VarUInt

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl BitOrAssign for VarUInt

source§

fn bitor_assign(&mut self, other: Self)

Performs the |= operation. Read more
source§

impl BitXor for VarUInt

§

type Output = VarUInt

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
source§

impl BitXorAssign for VarUInt

source§

fn bitxor_assign(&mut self, other: Self)

Performs the ^= operation. Read more
source§

impl Clone for VarUInt

source§

fn clone(&self) -> VarUInt

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VarUInt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VarUInt

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div for VarUInt

§

type Output = VarUInt

The resulting type after applying the / operator.
source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
source§

impl DivAssign for VarUInt

source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
source§

impl From<VarUInt> for f32

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for f64

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for i128

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for i16

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for i32

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for i64

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for i8

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for isize

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for u128

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for u16

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for u32

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for u64

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for u8

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<VarUInt> for usize

source§

fn from(value: VarUInt) -> Self

Converts to this type from the input type.
source§

impl From<u128> for VarUInt

source§

fn from(v: u128) -> Self

Converts to this type from the input type.
source§

impl From<u16> for VarUInt

source§

fn from(v: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for VarUInt

source§

fn from(v: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for VarUInt

source§

fn from(v: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for VarUInt

source§

fn from(v: u8) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VarUInt

source§

fn from(value: usize) -> Self

Converts to this type from the input type.
source§

impl FromStr for VarUInt

§

type Err = ParseError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for VarUInt

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul for VarUInt

§

type Output = VarUInt

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
source§

impl MulAssign for VarUInt

source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
source§

impl Neg for VarUInt

§

type Output = VarUInt

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Not for VarUInt

§

type Output = VarUInt

The resulting type after applying the ! operator.
source§

fn not(self) -> VarUInt

Performs the unary ! operation. Read more
source§

impl PartialEq for VarUInt

source§

fn eq(&self, other: &VarUInt) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Rem for VarUInt

§

type Output = VarUInt

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
source§

impl RemAssign for VarUInt

source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
source§

impl Shl for VarUInt

§

type Output = VarUInt

The resulting type after applying the << operator.
source§

fn shl(self, rhs: Self) -> Self::Output

Performs the << operation. Read more
source§

impl ShlAssign for VarUInt

source§

fn shl_assign(&mut self, other: Self)

Performs the <<= operation. Read more
source§

impl Shr for VarUInt

§

type Output = VarUInt

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: Self) -> Self::Output

Performs the >> operation. Read more
source§

impl ShrAssign for VarUInt

source§

fn shr_assign(&mut self, other: Self)

Performs the >>= operation. Read more
source§

impl Sub for VarUInt

§

type Output = VarUInt

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign for VarUInt

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl Copy for VarUInt

source§

impl StructuralPartialEq for VarUInt

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,