surrealdb-core-nightly 2.1.20250125

A nightly release of the surrealdb-core crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::idg::u32::U32;
use std::collections::HashMap;

#[derive(Default)]
pub(super) struct Stash(pub HashMap<Vec<u8>, U32>);

impl Stash {
	/// Set a key in the cache
	pub fn set(&mut self, key: Vec<u8>, val: U32) {
		self.0.insert(key, val);
	}
	/// Get a key from the cache
	pub fn get(&mut self, key: &[u8]) -> Option<U32> {
		self.0.get(key).cloned()
	}
}