vec_isize

Function vec_isize 

Source
pub fn vec_isize(bits: &Bits) -> Vec<isize>
Expand description

Converts a bit string to a vector of signed integers.

If the length of the the bit string is not divisible by the length of isize, it is sign-extended to the next length that is, then it is converted.

ยงExample

let bits = Bits::new([0x10, 0x32, 0x54, 0x76]);
let signed_ints = bits_as::vec_isize(&bits);

assert_eq!(signed_ints.len(), 1);
assert_eq!(signed_ints, vec![0x0000000076543210]);

let bits = Bits::from([0x10, 0x32, 0x54, 0x76]);
let signed_ints = bits_as::vec_i64(&bits);

assert_eq!(signed_ints.len(), 1);
assert_eq!(signed_ints, vec![0xFFFFFFFFF6543210u64 as i64]);