[][src]Trait varint_simd::num::VarIntTarget

pub trait VarIntTarget: Debug + Eq + PartialEq + Sized + Copy {
    type Signed: SignedVarIntTarget;

    pub const MAX_VARINT_BYTES: u8;
    pub const MAX_LAST_VARINT_BYTE: u8;

    pub fn vector_to_num(res: [u8; 16]) -> Self;
pub fn num_to_vector_stage1(self) -> [u8; 16];
pub fn zigzag(from: Self::Signed) -> Self;
pub fn unzigzag(self) -> Self::Signed; }

Represents an unsigned scalar value that can be encoded to and decoded from a varint.

Associated Types

type Signed: SignedVarIntTarget[src]

The signed version of this type

Loading content...

Associated Constants

pub const MAX_VARINT_BYTES: u8[src]

The maximum length of varint that is necessary to represent this number

pub const MAX_LAST_VARINT_BYTE: u8[src]

The maximum value of the last byte if the varint is MAX_VARINT_BYTES long such that the varint would not overflow the target

Loading content...

Required methods

pub fn vector_to_num(res: [u8; 16]) -> Self[src]

Converts a 128-bit vector to this number

Note: Despite operating on 128-bit SIMD vectors, these functions accept and return static arrays due to a lack of optimization capability by the compiler when passing or returning intrinsic vectors.

pub fn num_to_vector_stage1(self) -> [u8; 16][src]

Splits this number into 7-bit segments for encoding

pub fn zigzag(from: Self::Signed) -> Self[src]

ZigZag encodes this value

pub fn unzigzag(self) -> Self::Signed[src]

ZigZag decodes this value

Loading content...

Implementations on Foreign Types

impl VarIntTarget for u8[src]

type Signed = i8

impl VarIntTarget for u16[src]

type Signed = i16

impl VarIntTarget for u32[src]

type Signed = i32

impl VarIntTarget for u64[src]

type Signed = i64

Loading content...

Implementors

Loading content...