diff options
| author | Fuwn <[email protected]> | 2020-10-26 19:03:53 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-10-26 19:03:53 -0700 |
| commit | 9742614a1dc4699c1f2c69d923d402237672335d (patch) | |
| tree | a49f7d834372f37cef06b30a28ff1b40bdfaa079 /src/core/model.rs | |
| parent | Create README.md (diff) | |
| download | dep-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.rs | 33 |
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>>; +} |