pub struct Environment {
pub machine: String,
pub os: String,
pub arch: String,
pub date: String,
pub digest: Option<String>,
pub rerun: String,
pub host: Option<String>,
}Expand description
Where and when a figure was measured. Keep every field honest: a row without its environment is a claim about the present.
Fields§
§machine: StringCPU model and logical core count, as the OS reports them.
os: Stringstd::env::consts::OS.
arch: Stringstd::env::consts::ARCH.
date: StringUTC date, YYYY-MM-DD.
digest: Option<String>The server image digest, when the caller ran one (sha256:...).
rerun: StringThe command that reproduces this run.
host: Option<String>What the host was doing at the start and end of the run (load, available RAM; see
host_snapshot), for runs where that decides whether a figure means anything. None when
not recorded. It is evidence, not part of comparable_key.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn detect(rerun: impl Into<String>, digest: Option<String>) -> Self
pub fn detect(rerun: impl Into<String>, digest: Option<String>) -> Self
Read the machine, OS, architecture and date; the caller supplies the re-run command and the image digest, if any.
Sourcepub fn comparable_key(&self) -> String
pub fn comparable_key(&self) -> String
What decides whether two rows may be compared: same machine, OS and architecture.