2 source::secret::Secret,
3 utils::{ActualDbPool, DbPool},
6 rate_limit::RateLimitCell,
7 settings::{structs::Settings, SETTINGS},
9 use reqwest_middleware::ClientWithMiddleware;
13 pub struct LemmyContext {
15 client: Arc<ClientWithMiddleware>,
17 rate_limit_cell: RateLimitCell,
23 client: ClientWithMiddleware,
25 rate_limit_cell: RateLimitCell,
29 client: Arc::new(client),
30 secret: Arc::new(secret),
34 pub fn pool(&self) -> DbPool<'_> {
35 DbPool::Pool(&self.pool)
37 pub fn inner_pool(&self) -> &ActualDbPool {
40 pub fn client(&self) -> &ClientWithMiddleware {
43 pub fn settings(&self) -> &'static Settings {
46 pub fn secret(&self) -> &Secret {
49 pub fn settings_updated_channel(&self) -> &RateLimitCell {