aboutsummaryrefslogtreecommitdiff
path: root/src/core/model.rs
blob: 1b19f13f45a4622ce440527d7ee01ee0360c1f4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use crate::core::api;
use crate::core::timers::TimerClient;
use crate::db::Database;
use serenity::client::bridge::{
    gateway::ShardManager,
    // voice::ClientVoiceManager
};
use serenity::model::id::UserId;
use serenity::prelude::Mutex;
// use serenity::voice;
use std::sync::Arc;
use typemap::Key;

pub struct Owner;
impl Key for Owner {
    type Value = UserId;
}

pub struct SerenityShardManager;
impl Key for SerenityShardManager {
    type Value = Arc<Mutex<ShardManager>>;
}

pub struct ApiClient;
impl Key for ApiClient {
    type Value = Arc<api::ApiClient>;
}

pub struct DB;
impl Key for DB {
    type Value = Arc<Database>;
}

pub struct TC;
impl Key for TC {
    type Value = Arc<Mutex<TimerClient>>;
}

// pub struct VoiceManager;
// impl Key for VoiceManager {
//     type Value = Arc<Mutex<ClientVoiceManager>>;
// }