1 use crate::websocket::chat_server::ChatServer;
2 use lemmy_db_schema::{source::secret::Secret, utils::DbPool};
4 rate_limit::RateLimitCell,
5 settings::{structs::Settings, SETTINGS},
7 use reqwest_middleware::ClientWithMiddleware;
11 pub struct LemmyContext {
13 chat_server: Arc<ChatServer>,
14 client: Arc<ClientWithMiddleware>,
16 rate_limit_cell: RateLimitCell,
22 chat_server: Arc<ChatServer>,
23 client: ClientWithMiddleware,
25 rate_limit_cell: RateLimitCell,
30 client: Arc::new(client),
31 secret: Arc::new(secret),
35 pub fn pool(&self) -> &DbPool {
38 pub fn chat_server(&self) -> &Arc<ChatServer> {
41 pub fn client(&self) -> &ClientWithMiddleware {
44 pub fn settings(&self) -> &'static Settings {
47 pub fn secret(&self) -> &Secret {
50 pub fn settings_updated_channel(&self) -> &RateLimitCell {