aboutsummaryrefslogtreecommitdiff
path: root/src/core/model.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2020-10-26 19:03:53 -0700
committerFuwn <[email protected]>2020-10-26 19:03:53 -0700
commit9742614a1dc4699c1f2c69d923d402237672335d (patch)
treea49f7d834372f37cef06b30a28ff1b40bdfaa079 /src/core/model.rs
parentCreate README.md (diff)
downloaddep-core-next-9742614a1dc4699c1f2c69d923d402237672335d.tar.xz
dep-core-next-9742614a1dc4699c1f2c69d923d402237672335d.zip
repo: push main from local to remote
Diffstat (limited to 'src/core/model.rs')
-rw-r--r--src/core/model.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/core/model.rs b/src/core/model.rs
new file mode 100644
index 0000000..ade2930
--- /dev/null
+++ b/src/core/model.rs
@@ -0,0 +1,33 @@
+use crate::core::api;
+use crate::core::timers::TimerClient;
+use crate::db::Database;
+use serenity::client::bridge::gateway::ShardManager;
+use serenity::model::id::UserId;
+use serenity::prelude::Mutex;
+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>>;
+}