MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / insert_and_get

Function insert_and_get

nodedb/src/engine/timeseries/last_value_cache.rs:125–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123
124 #[test]
125 fn insert_and_get() {
126 let mut cache = LastValueCache::new();
127 let sid = sid(42);
128
129 assert!(cache.update(sid, 1000, 87.3));
130 let entry = cache.get(sid).unwrap();
131 assert_eq!(entry.ts, 1000);
132 assert!((entry.value - 87.3).abs() < 1e-12);
133 }
134
135 #[test]
136 fn newer_timestamp_updates() {

Callers

nothing calls this directly

Calls 2

sidFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected