Skip to main content

Crate gander_core

Crate gander_core 

Source
Expand description

gander-core — platform data collection and process model.

This crate must not depend on any UI crate. That keeps the parsers testable against fixtures on any host, and makes a --json batch mode (and future non-TUI front ends) nearly free.

Two backends exist:

  • linux — reads /proc and /sys. Parametrised by a root path, so the entire read path is testable from fixtures on any unix.
  • [darwin] — uses libproc, sysctl and Mach host statistics.

Both produce the same row::Row / system::SystemSnapshot types, so the UI and configuration layers are platform-independent.

See docs/DESIGN.md and docs/PORTABILITY.md.

Re-exports§

pub use linux::LinuxPlatform as CurrentPlatform;

Modules§

action
Process actions.
affinity
CPU affinity: which cores a process may run on.
capability
Platform capabilities that vary per OS, resolved at compile time.
format
Human-readable formatting.
linux
The /proc backend. Compiles on any unix because the IO layer is parameterised by a root path; only Linux has a live /proc to point it at. Linux /proc and /sys access.
row
Field identifiers and their presentation metadata.
system
System-wide snapshots: CPU, memory, swap, load, uptime.
table
The process table: scan, cache, derive, sort, filter.
tree
Tree-view construction.
users
uid to user-name resolution.

Structs§

ScanOptions
What the front end is currently showing, and therefore what the sampler has to pay for.

Constants§

PLATFORM_SUPPORTED
Whether a live backend exists for this build.

Traits§

PlatformSampler
A unified sampler interface so the front end does not name a backend.

Type Aliases§

Pid
Process identifier.
Sampler
The sampler for the current target.