#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

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 21/week @ 2021-01-02 25/week @ 2021-01-09 17/week @ 2021-01-16 35/week @ 2021-01-23 10/week @ 2021-01-30 40/week @ 2021-02-06 94/week @ 2021-02-13 19/week @ 2021-02-20 18/week @ 2021-02-27 32/week @ 2021-03-06 39/week @ 2021-03-13 46/week @ 2021-03-20 244/week @ 2021-03-27 396/week @ 2021-04-03 450/week @ 2021-04-10 648/week @ 2021-04-17

119 downloads per month
Used in 2 crates

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.2MB
~21K SLoC