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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use super::builder::ShardScheme;
use crate::shard::{Config as ShardConfig, ResumeSession};
use std::{collections::HashMap, sync::Arc};
use twilight_gateway_queue::Queue;
use twilight_http::Client;
#[derive(Debug)]
pub struct Config {
pub(super) http_client: Client,
pub(super) shard_config: ShardConfig,
pub(super) shard_scheme: ShardScheme,
pub(super) queue: Arc<Box<dyn Queue>>,
pub(super) resume_sessions: HashMap<u64, ResumeSession>,
}
impl Config {
pub fn http_client(&self) -> &Client {
&self.http_client
}
pub fn shard_config(&self) -> &ShardConfig {
&self.shard_config
}
pub fn shard_scheme(&self) -> &ShardScheme {
&self.shard_scheme
}
pub fn queue(&self) -> &Arc<Box<dyn Queue>> {
&self.queue
}
}
#[cfg(test)]
mod tests {
use super::Config;
use static_assertions::assert_impl_all;
use std::fmt::Debug;
assert_impl_all!(Config: Debug, Send, Sync);
}