UnsignedInteger

Trait UnsignedInteger 

Source
pub trait UnsignedInteger:
    Sized
    + Copy
    + PartialEq
    + Eq
    + Debug
    + Display
    + Default
    + Shl<u8, Output = Self>
    + ShlAssign
    + Shr<u8, Output = Self>
    + ShrAssign
    + BitAnd<Output = Self>
    + BitAndAssign
    + BitOr<Output = Self>
    + BitOrAssign
    + Add<Output = Self>
    + AddAssign
    + Sub<Output = Self>
    + SubAssign
    + Mul<Output = Self>
    + MulAssign
    + Div<Output = Self>
    + DivAssign
    + Endianness
    + One
    + Zero
    + OneHundredTwentySeven
    + Max
    + Min
    + ByteLength {
    // Provided methods
    fn encode_uint(self, writer: &mut impl Write) -> Result<usize> { ... }
    fn decode_uint(reader: &mut impl Read) -> Result<Self> { ... }
}
Expand description

Trait implemented by all supported unsigned integer types.

This unifies the operations and constants needed by the varint implementation and provides helpers to encode/decode using the active scheme.

Provided Methods§

Source

fn encode_uint(self, writer: &mut impl Write) -> Result<usize>

Encodes this unsigned integer using the active varint scheme.

Source

fn decode_uint(reader: &mut impl Read) -> Result<Self>

Decodes an unsigned integer using the active varint scheme.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl UnsignedInteger for u8

Source§

impl UnsignedInteger for u16

Source§

impl UnsignedInteger for u32

Source§

impl UnsignedInteger for u64

Source§

impl UnsignedInteger for u128

Source§

impl UnsignedInteger for usize

Implementors§