Skip to main content

linsight_core/
lib.rs

1// SPDX-FileCopyrightText: 2026 VisorCraft LLC
2// SPDX-License-Identifier: GPL-3.0-only
3#![forbid(unsafe_code)]
4#![deny(rust_2018_idioms)]
5
6pub mod atomic_write;
7/// Schema version embedded in saved dashboard JSON. Bump on any
8/// incompatible change to the on-disk layout format.
9pub const DASHBOARD_SCHEMA_VERSION: u32 = 1;
10
11pub mod error;
12pub mod hardware;
13pub mod paths;
14pub mod time;
15pub mod types;
16
17pub use atomic_write::atomic_write_json;
18
19pub use error::{CoreError, CoreResult};
20pub use hardware::{
21    HardwareCategory, HardwareDevice, HardwareDeviceKey, KeyError, NICKNAME_MAX_CHARS,
22    NicknameError, compute_device_label, parse_sysfs_pci_id, validate_nickname,
23};
24pub use paths::history_db_path;
25pub use time::parse_duration_dhm;
26pub use types::SnapshotCache;
27pub use types::*;
28
29/// Sensor tag marking a value as effectively constant for the process
30/// lifetime (e.g. total VRAM / RAM capacity). The daemon's scheduler
31/// samples a `STATIC_TAG` sensor once per subscription instead of polling
32/// it, and the GUI both omits its trend chart and renders it as a rounded
33/// whole-GB capacity rather than a fractional binary size. Plugins opt in
34/// by pushing this string into a sensor's `tags`.
35pub const STATIC_TAG: &str = "static";