macstate_core/lib.rs
1//! macstate-core: macOS system signal collection.
2//!
3//! Exposes network and power signals as serde-serializable structs.
4
5pub mod network;
6pub mod power;
7
8use serde::Serialize;
9
10#[derive(Debug, Clone, Serialize)]
11pub struct State {
12 pub network: network::Network,
13 pub power: power::Power,
14}
15
16impl State {
17 pub fn collect() -> Self {
18 Self {
19 network: network::Network::collect(),
20 power: power::Power::collect(),
21 }
22 }
23}