use crate::queries; use std::cell::Cell; #[salsa::database(queries::GroupStruct)] #[derive(Default)] pub(crate) struct DatabaseImpl { runtime: salsa::Runtime, counter: Cell, } impl queries::Counter for DatabaseImpl { fn increment(&self) -> usize { let v = self.counter.get(); self.counter.set(v + 1); v } } impl salsa::Database for DatabaseImpl { fn salsa_runtime(&self) -> &salsa::Runtime { &self.runtime } }