sys-lib 0.2.0

System facts for Rust services: OS, CPU, memory, disks, network, host, this process, virtualization, power, and device identity, container-aware by default, plus build info, instance info, and a process guard. No subprocesses, zero third-party dependencies.
Documentation
# =============================================================================
#  R E P S   ยท   sys-lib
# =============================================================================
[package]
name    = "sys-lib"
version = "0.2.0"

# Minimum Supported Rust Version (MSRV)
# 1.89: `std::fs::File::lock` and `File::try_lock` are stable from 1.89.0, so
# the process guard needs no lock FFI (dev/PLAN.md, D-002).
rust-version = "1.89"
edition = "2024"

# License
license = "Apache-2.0 OR MIT"

# Readme
readme = "README.md"

# Description
description = "System facts for Rust services: OS, CPU, memory, disks, network, host, this process, virtualization, power, and device identity, container-aware by default, plus build info, instance info, and a process guard. No subprocesses, zero third-party dependencies."

# Keywords (5 max)
keywords = ["system", "hardware", "cpu", "memory", "os"]

# Categories
categories = ["os", "hardware-support"]

# Links
homepage      = "https://github.com/jamesgober/sys-lib"
repository    = "https://github.com/jamesgober/sys-lib"
documentation = "https://docs.rs/sys-lib"

# Authors
authors = ["James Gober <me@jamesgober.com>"]

# Fixture machines (thousands of small files) and the fuzz crate stay in the
# repository; fixture tests skip when the tree is absent (dev/PLAN.md, D-018).
exclude = ["/tests/fixtures/", "/fuzz/"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
# Every platform's items appear on docs.rs, each with its doc(cfg) badge.
targets = ["x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc", "aarch64-apple-darwin"]

[lib]
name = "sys_lib"
path = "src/lib.rs"


# FEATURE FLAGS
# #################################
[features]
default = ["instance", "guard"]

# Instance info: `Instance`, `InstanceId` (brings clock-lib and id-forge).
instance = []

# Process guard: `process::guard`, `Guard` (brings path-lib).
guard = []

# Device identity: the `device` module (brings crypt-io). Off by default:
# device identifiers carry privacy obligations; the caller opts in knowingly.
device-id = []


# DEPENDENCIES
# #################################
[dependencies]
# None yet. Planned first-party dependencies and the reason for each are
# listed in dev/PLAN.md section 16; each is added, by published version, with
# the first code that needs it. No third-party runtime dependencies.


# DEV DEPENDENCIES
# #################################
[dev-dependencies]

# Test oracles only, never runtime dependencies: the unit tests in
# src/sys/<platform>/ffi.rs compare the size, alignment, and every field offset
# of sys-lib's own #[repr(C)] OS structs with these crates' definitions, on
# every CI target (dev/PLAN.md, D-012).
[target.'cfg(unix)'.dev-dependencies]
libc = "0.2.170"

[target.'cfg(windows)'.dev-dependencies]
windows-sys = { version = "0.61", features = [
    "Win32_Foundation",
    "Win32_NetworkManagement_IpHelper",
    "Win32_NetworkManagement_Ndis",
    "Win32_Networking_WinSock",
    "Win32_Security",
    "Win32_System_Diagnostics_ToolHelp",
    "Win32_System_Ioctl",
    "Win32_System_JobObjects",
    "Win32_System_Power",
    "Win32_System_ProcessStatus",
    "Win32_System_Registry",
    "Win32_System_SystemInformation",
    "Win32_System_Threading",
    "Win32_System_Time",
    "Win32_System_WindowsProgramming",
] }


# RELEASE PROFILE
# #################################
[profile.release]
opt-level     = 3
lto           = "fat"
codegen-units = 1
panic         = "abort"
strip         = "symbols"