Trait integer_encoding::FixedInt [] [src]

pub trait FixedInt: Sized + Copy {
    fn required_space() -> usize;
fn encode_fixed(self, _: &mut [u8]);
fn decode_fixed(_: &[u8]) -> Self; fn encode_fixed_vec(self) -> Vec<u8> { ... }
fn decode_fixed_vec(v: &Vec<u8>) -> Self { ... } }

FixedInt provides encoding/decoding to and from fixed int representations. The emitted bytestring contains the bytes of the integer in little-endian order.

Required Methods

Returns how many bytes are required to represent the given type.

Encode a value into the given slice.

Decode a value from the given slice.

Provided Methods

Helper: Encode the value and return a Vec.

Helper: Decode the value from the Vec.

Implementations on Foreign Types

impl FixedInt for usize
[src]

impl FixedInt for u64
[src]

impl FixedInt for u32
[src]

impl FixedInt for u16
[src]

impl FixedInt for isize
[src]

impl FixedInt for i64
[src]

impl FixedInt for i32
[src]

impl FixedInt for i16
[src]

Implementors