#freebsd #executable #detecting #64-bit #32-bit #gnu-linux

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

#320 in Operating systems

Download history 418/week @ 2024-01-03 304/week @ 2024-01-10 403/week @ 2024-01-17 385/week @ 2024-01-24 642/week @ 2024-01-31 527/week @ 2024-02-07 456/week @ 2024-02-14 552/week @ 2024-02-21 590/week @ 2024-02-28 520/week @ 2024-03-06 413/week @ 2024-03-13 465/week @ 2024-03-20 395/week @ 2024-03-27 335/week @ 2024-04-03 338/week @ 2024-04-10 258/week @ 2024-04-17

1,418 downloads per month
Used in 4 crates (3 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.3–8.5MB
~59K SLoC