num-packer
Provides traits and implementations for packing and unpacking two numbers into a single value.
Implementations
- Pack two
boolintou8/i8,u16/i16,u32/i32,u64/i64,usize/isize - Pack two
u8intou16/i16,u32/i32,u64/i64,usize/isize - Pack two
u16intou32/i32,u64/i64,usize/isize(if target pointer width is 32 or 64) - Pack two
u32intou64/i64,usize/isize(if target pointer width is 64) - Pack two
i8intou16/i16,u32/i32,u64/i64,usize/isize - Pack two
i16intou32/i32,u64/i64,usize/isize(if target pointer width is 32 or 64) - Pack two
i32intou64/i64,usize/isize(if target pointer width is 64)
Example
Pack two u8 into u16.
use U8Packer;
let packed = u16pack_u8;
let = packed.unpack_u8;
assert_eq!;
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.