[][src]Crate heim

heim is a fast and eventually fully-featured async library for the Rust programming language intended to provide any possible information about the system it is running on.

At a high level, it provides information about:

  • CPU
  • Disks
  • Host
  • Memory
  • Networks
  • Processes
  • Virtualization (in progress)
  • Hardware sensors (in progress)

Platform support

At the moment, heim is in MVP phase, which means that there is only only partial support for Tier 1 platforms (Linux, macOS, and Windows for i686 and x86_64). You can check the GitHub projects page for more information.

In addition, it would be good to double check if the returned information is correct. You know, just in case.

Feature flags

Heim uses a set of feature flags to reduce the amount of compiled code. In general, these feature flags can be split into two groups:

  1. System components: each one of these enables functionality for fetching information about some specific system part (ex. CPU or memory information).
    All these features are disabled by default. See modules list below for available features.

    Alternatively you can use full feature to enable all components at once.

  2. Async runtimes support. Heim can integrate with popular async runtimes and also provides a fallback implementation for other use cases.

    • runtime-tokio: Enables integration with tokio
    • runtime-async-std: Enables integration with async-std
    • runtime-polyfill: Enables bundled polyfill implementation for async routines, with all potentially blocking operations executed on the current thread. Other runtime integrations should be used preferably.

    None of these runtime features are enabled by default and you are required to explicitly opt-in to use one of them. Enabling multiple runtimes at once is also forbidden and will lead to the compilation error.

Documentation

Note that heim also provides platform-specific APIs. If you are browsing this documentation via docs.rs, do not forget to use the platform selector at the page header.

Also, due to Rust bug #15823, type aliases are not rendered properly across the sub-crates bounds, therefore documentation might look terrible in some places, consider checking the sources or sub-crates documentation in such case.

Modules

cpufeature="cpu"

CPU information.

diskfeature="disk"

Disks information.

hostfeature="host"

Host system information.

memoryfeature="memory"

Memory and swap information.

netfeature="net"

Network information.

processfeature="process"

System processes information.

sensorsfeature="sensors"

Sensors information.

units

Measurement units used in API.

virtfeature="virt"

Virtualization system detection.

Structs

Error

Error type for data fetching operations.

Type Definitions

Result

A specialized Result type for data fetching functions.