Skip to main content

commit_bridge/
state.rs

1//! State of the application.
2
3use crate::{config::Config, repository::SqliteRepository};
4use std::sync::Arc;
5
6/// Holds data accessible from each [handler].
7///
8/// <!-- LINKS -->
9/// [handler]: crate::handler
10#[derive(Debug, Clone)]
11pub struct AppState {
12    /// Application configuration.
13    pub config: Arc<Config>,
14
15    /// Repository for data access.
16    pub repository: Arc<SqliteRepository>,
17
18    /// SQLx connection pool for the SQLite database.
19    pub db_pool: sqlx::SqlitePool,
20}