You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2b-rs/src/utils/store.rs

23 lines
409 B
Rust

use crate::database::Database;
use parking_lot::Mutex;
use serenity::prelude::TypeMapKey;
use std::sync::Arc;
pub struct Store;
pub struct StoreData {
pub database: Arc<Mutex<Database>>,
}
impl StoreData {
pub fn new(database: Database) -> StoreData {
Self {
database: Arc::new(Mutex::new(database)),
}
}
}
impl TypeMapKey for Store {
type Value = StoreData;
}