Skip to content
//! Shared handler state.

use std::sync::Arc;

use crate::config::ServerConfig;
use crate::docker::DockerInventory;
use crate::jobs::JobRegistry;

/// Everything a handler needs, cheap to clone.
#[derive(Clone, Debug)]
pub(crate) struct AppState {
    /// Loaded configuration, including the API key.
    pub(crate) config: Arc<ServerConfig>,
    /// Read-only Docker inventory.
    pub docker: Arc<DockerInventory>,
    /// Job registry driving the `once` binary.
    pub jobs: Arc<JobRegistry>,
}