pub struct EnvState {
pub ac_online: bool,
pub idle: Option<Duration>,
pub cpu_pct: Option<f64>,
pub network_up: bool,
}Expand description
Host-environment state sensed by the agent, fed to require_met.
A named struct (not positional args) so the growing set of sensed
signals — several of them bool — can’t be transposed at a call
site. The Win32 sensing lives in kanade-agent::env_gate.
Fields§
§ac_online: boolIs the host on AC power (false if on battery or unreadable).
idle: Option<Duration>How long the console has been idle (None = couldn’t determine).
cpu_pct: Option<f64>Whole-machine CPU usage 0–100 (None = no sample yet).
network_up: boolDoes the host have internet connectivity (false if offline /
LAN-only / unreadable).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EnvState
impl RefUnwindSafe for EnvState
impl Send for EnvState
impl Sync for EnvState
impl Unpin for EnvState
impl UnsafeUnpin for EnvState
impl UnwindSafe for EnvState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more