#64-bit #x86 #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

#522 in Operating systems

Download history 400/week @ 2024-07-21 840/week @ 2024-07-28 783/week @ 2024-08-04 634/week @ 2024-08-11 558/week @ 2024-08-18 895/week @ 2024-08-25 685/week @ 2024-09-01 785/week @ 2024-09-08 788/week @ 2024-09-15 656/week @ 2024-09-22 1331/week @ 2024-09-29 1738/week @ 2024-10-06 1682/week @ 2024-10-13 1934/week @ 2024-10-20 2090/week @ 2024-10-27 2012/week @ 2024-11-03

8,030 downloads per month
Used in 6 crates (4 directly)

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.2–7.5MB
~51K SLoC