Trait SignedVarIntTarget

Source
pub trait SignedVarIntTarget:
    Debug
    + Eq
    + PartialEq
    + Sized
    + Copy {
    type Unsigned: VarIntTarget<Signed = Self>;

    // Provided methods
    fn zigzag(from: Self) -> Self::Unsigned { ... }
    fn unzigzag(from: Self::Unsigned) -> Self { ... }
}
Expand description

Represents a signed scalar value that can be encoded to and decoded from a varint in ZigZag format.

Required Associated Types§

Source

type Unsigned: VarIntTarget<Signed = Self>

Provided Methods§

Source

fn zigzag(from: Self) -> Self::Unsigned

ZigZag encodes this value

Source

fn unzigzag(from: Self::Unsigned) -> Self

ZigZag decodes this value

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 SignedVarIntTarget for i8

Source§

impl SignedVarIntTarget for i16

Source§

impl SignedVarIntTarget for i32

Source§

impl SignedVarIntTarget for i64

Implementors§