Files
antifed/backend/src/models/mod.rs
T
2026-07-26 10:55:59 +02:00

23 lines
521 B
Rust

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<ConnectionManager<PgConnection>>,
pub mailer: Arc<Mutex<SmtpTransport>>,
}
impl AppState {
pub fn new(pool: Pool<ConnectionManager<PgConnection>>, mailer: SmtpTransport) -> Self {
Self {
db: pool,
mailer: Arc::new(Mutex::new(mailer)),
}
}
}