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

Function getset_new_key

nodedb/src/engine/kv/engine_atomic.rs:609–615  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

607
608 #[test]
609 fn getset_new_key() {
610 let mut engine = make_engine();
611 let old = engine.getset(1, "session", b"tok", b"new-token", 1000);
612 assert!(old.is_none());
613 let val = engine.get(1, "session", b"tok", 1000);
614 assert_eq!(val.as_deref(), Some(b"new-token".as_slice()));
615 }
616
617 #[test]
618 fn getset_existing_key() {

Callers

nothing calls this directly

Calls 3

getsetMethod · 0.80
make_engineFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected