42 releases (20 stable)

new 2.0.0-pre.0 Nov 19, 2024
1.5.2 Sep 3, 2024
1.5.1 Mar 10, 2024
1.4.1 Jun 26, 2023
0.1.1 Aug 4, 2017

#292 in Operating systems

Download history 428313/week @ 2024-07-30 438383/week @ 2024-08-06 470538/week @ 2024-08-13 482189/week @ 2024-08-20 470992/week @ 2024-08-27 530174/week @ 2024-09-03 522547/week @ 2024-09-10 481911/week @ 2024-09-17 550833/week @ 2024-09-24 552079/week @ 2024-10-01 562329/week @ 2024-10-08 599159/week @ 2024-10-15 623789/week @ 2024-10-22 616806/week @ 2024-10-29 602137/week @ 2024-11-05 632823/week @ 2024-11-12

2,589,408 downloads per month
Used in 1,847 crates (258 directly)

Apache-2.0 OR BSL-1.0 OR MIT

79KB
2K SLoC

WhoAmI Logo

Changelog | Source | Getting Started

tests GitHub commit activity GitHub contributors
Crates.io Crates.io Crates.io (recent)
Crates.io Docs.rs

Retrieve the current user and environment through simple functions.

Check out the documentation for examples.

Features

  • Get the user's full name
  • Get the user's username
  • Get the user's preferred language(s)
  • Get the devices's hostname
  • Get the devices's "pretty" or "fancy" name
  • Get the devices's desktop environment
  • Get the devices's OS name and version
  • Get the devices's platform name
  • Get the devices's CPU architecture and its width

Supported Platforms

WhoAmI targets all platforms that can run Rust, including:

  • Linux
  • Windows
  • Mac OS
  • BSD variants (FreeBSD, others)
  • illumos variants (SmartOS, OmniOS, others) Target-Specific MSRV 1.65
  • Redox Target-Specific MSRV 1.65
  • Web Assembly
    • Fake implementation
    • Web Browser - DOM
    • WASI (Wasite, others) untested, testing planned later
    • Daku (Ardaku/Quantii, others) planned later
  • Android planned later
  • iOS / watchOS / tvOS planned later
  • Fuchsia planned later
  • GNU/Hurd untested
  • Others? (make a PR or open an issue)

MSRV

WhoAmI 1.x.y targets Rust 1.40.0 stable and later, and the 1.x.y track will be maintained at least until the release of the Rust 2024 edition.

The MSRV will not be updated until version 2.0.0, after which breaking changes may happen on minor releases, and version 2.0.0 will target Rust 1.65.0 and later to make use of the let else syntax. The current plan is for all 2.x releases to be supported and receive bugfixes at least until sometime in 2027, bumping MSRV only as needed.

Binary

whome: whoami command RiR (Re-written in Rust) that depends on this crate.

Testing

The testing procedure is documented at https://github.com/ardaku/whoami/blob/v1/TESTING.md. The full manual test suite is run for each change that affects multiple platforms.

License

Copyright © 2017-2024 The WhoAmI Contributors.

Licensed under any of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as described above, without any additional terms or conditions.

Help

If you want help using or contributing to this library, feel free to send me an email at aldaronlau@gmail.com.

Dependencies

~0–2.3MB
~43K SLoC