rustolio-db 0.1.0

An DB extention for the rustolio HTTP-Server
Documentation
//
// SPDX-License-Identifier: MPL-2.0
//
// Copyright (c) 2026 Tobias Binnewies. All rights reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//

mod error;
// mod hasher;
mod key;
mod test_utils;
mod value;

#[cfg(not(target_arch = "wasm32"))]
mod store;

use rustolio_utils::prelude::*;

pub mod client;

pub use error::{Error, Result};
pub use key::{Key, KeyType};
pub use value::Value;

const DATA_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/data");

#[cfg(not(target_arch = "wasm32"))]
#[derive(Debug, service::Service)]
pub struct Service {
    store_service: store::Service,
}

#[cfg(not(target_arch = "wasm32"))]
impl Default for Service {
    fn default() -> Self {
        Self::new()
    }
}

impl Service {
    pub fn new() -> Self {
        Service {
            store_service: store::Service::new(1_000, DATA_DIR.into()),
        }
    }
}