lensbench_engine/
provenance.rs1use lensbench_core::System;
4use serde_json::{json, Value};
5
6thread_local! {
7 static LOADED_HASH: std::cell::RefCell<Option<String>> = const { std::cell::RefCell::new(None) };
9}
10
11pub fn set(s: &System) {
13 let h = lensbench_project::sysfile::system_hash(s).ok();
14 LOADED_HASH.with(|x| *x.borrow_mut() = h);
15}
16
17pub fn clear() {
19 LOADED_HASH.with(|x| *x.borrow_mut() = None);
20}
21
22pub fn value() -> Value {
24 let h = LOADED_HASH.with(|x| x.borrow().clone());
25 json!({ "lensbench": lensbench_core::VERSION, "system_hash": h })
26}