pub struct Environment {
pub machine: String,
pub os: String,
pub arch: String,
pub date: String,
pub digest: Option<String>,
pub rerun: 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.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn detect(rerun: impl Into<String>, digest: Option<String>) -> Environment
pub fn detect(rerun: impl Into<String>, digest: Option<String>) -> Environment
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.
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Environment
impl Debug for Environment
impl Eq for Environment
Source§impl PartialEq for Environment
impl PartialEq for Environment
impl StructuralPartialEq for Environment
Auto Trait Implementations§
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
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