From 8a4f311c1d1fa4d978c93e58d95bf59a8a38b587 Mon Sep 17 00:00:00 2001 From: Kevin Hoerr Date: Wed, 25 Feb 2026 22:28:26 +0000 Subject: Add context and initialization --- src/main/rust/store/mod.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/rust/store/mod.rs (limited to 'src/main/rust/store/mod.rs') diff --git a/src/main/rust/store/mod.rs b/src/main/rust/store/mod.rs new file mode 100644 index 0000000..42f1809 --- /dev/null +++ b/src/main/rust/store/mod.rs @@ -0,0 +1,32 @@ +pub mod sqlite; + +use miette::Result; + +pub enum Context { + SQLite(sqlite::SQLite), +} + +impl Default for Context { + fn default() -> Self { + Context::SQLite(sqlite::SQLite::default()) + } +} + +pub trait Store { + fn init(&mut self) -> Result<()>; +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn context_default() { + let context = Context::default(); + + let res = match context { + Context::SQLite(_) => true, + }; + assert!(res); + } +} -- cgit v1.3