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§
Sourcefn encode_uint(self, writer: &mut impl Write) -> Result<usize>
fn encode_uint(self, writer: &mut impl Write) -> Result<usize>
Encodes this unsigned integer using the active varint scheme.
Sourcefn decode_uint(reader: &mut impl Read) -> Result<Self>
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.