pub trait ZigZag {
type UInt;
// Required methods
fn zigzag_encode(value: Self) -> Self::UInt;
fn zigzag_decode(value: Self::UInt) -> Self;
}Expand description
Trait for ZigZag encoding, used to convert signed integers to unsigned integers
Required Associated Types§
Required Methods§
Sourcefn zigzag_encode(value: Self) -> Self::UInt
fn zigzag_encode(value: Self) -> Self::UInt
Encode a signed integer to an unsigned integer
Sourcefn zigzag_decode(value: Self::UInt) -> Self
fn zigzag_decode(value: Self::UInt) -> Self
Decode an unsigned integer back to a signed integer
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.