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);
}