use diesel::PgConnection; use diesel::r2d2::{ConnectionManager, Pool}; use lettre::SmtpTransport; use std::sync::{Arc, Mutex}; pub const DEFAULT_QUERY_LIMIT: i64 = 100; pub mod action; pub struct AppState { pub db: Pool>, pub mailer: Arc>, } impl AppState { pub fn new(pool: Pool>, mailer: SmtpTransport) -> Self { Self { db: pool, mailer: Arc::new(Mutex::new(mailer)), } } }