#windows #freebsd #executable

bin+lib bitness

Rust library for detecting OS bitness independently of the executable’s bitness. Windows, GNU/Linux and FreeBSD currently supported.

7 unstable releases

new 0.4.0 Nov 20, 2020
0.3.3 Jan 17, 2018
0.2.0 Jan 13, 2018
0.1.0 Jan 11, 2018
Download history 9/week @ 2020-08-06 23/week @ 2020-08-13 48/week @ 2020-08-20 19/week @ 2020-08-27 29/week @ 2020-09-03 16/week @ 2020-09-10 17/week @ 2020-09-17 20/week @ 2020-09-24 58/week @ 2020-10-01 32/week @ 2020-10-08 145/week @ 2020-10-15 76/week @ 2020-10-22 91/week @ 2020-10-29 124/week @ 2020-11-05 201/week @ 2020-11-12 114/week @ 2020-11-19

310 downloads per month
Used in codesign

MIT/Apache

10KB
87 lines

Bitness Build Status Build status Crates.io

Rust library for detecting OS bitness independently of the executable's bitness. Windows, GNU/Linux and FreeBSD currently supported.

How to use

let bitness = bitness::os_bitness().unwrap();

match bitness {
  Bitness::X86_32 => println!("We're 32-bit!"),
  Bitness::X86_64 => println!("We're 64-bit!"),
  _ => { }
}

Dependencies

~0.4–1.3MB
~23K SLoC