teaql-tool-extra 0.1.1

Heavy-dependency extra utilities for the TeaQL Tool ecosystem.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use teaql_tool_core::{Result, TeaQLToolError};

#[derive(Debug, Clone)]
pub struct KvTool;

impl KvTool {
    pub fn new() -> Self { Self }

    pub fn open(&self, path: &str) -> Result<sled::Db> {
        sled::open(path).map_err(|e| TeaQLToolError::ExecutionError(e.to_string()))
    }
}

impl Default for KvTool {
    fn default() -> Self { Self::new() }
}