lariv-rs 0.1.0

Compile-time plugin web application framework built on Axum, SeaORM, Maud, and HTMX
Documentation
//! Shared Axum state for filesystem routes (DB, filestore, config).
use std::sync::Arc;

use sea_orm::DatabaseConnection;

use super::config::FilesystemConfig;
use super::storage::DynFilestore;

/// Shared Axum state for the filesystem plugin routes.
#[derive(Clone)]
pub struct FilesystemState {
    pub db: DatabaseConnection,
    /// Backend chosen from `[filesystem]` — see [`DynFilestore`].
    pub store: Arc<DynFilestore>,
    pub config: FilesystemConfig,
}

impl FilesystemState {
    pub fn new(db: DatabaseConnection, store: Arc<DynFilestore>, config: FilesystemConfig) -> Self {
        Self { db, store, config }
    }
}