#![allow(clippy::exhaustive_structs, reason = "Configuration structs")]
use crate::app::config::LoadingBehavior;
use serde::{Deserialize, Serialize};
use smart_default::SmartDefault;
use std::path::PathBuf;
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, SmartDefault)]
pub struct Config {
#[serde(rename = "protected")]
pub protected_assets: ProtectedAssets,
#[serde(rename = "public")]
pub public_assets: PublicAssets,
pub static_files: StaticFiles,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, SmartDefault)]
pub struct ProtectedAssets {
#[default(LoadingBehavior::Deny)]
pub behavior: LoadingBehavior,
#[default = "content"]
pub local_path: PathBuf,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, SmartDefault)]
pub struct PublicAssets {
#[default(LoadingBehavior::Deny)]
pub behavior: LoadingBehavior,
#[default = "static"]
pub local_path: PathBuf,
}
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, SmartDefault)]
pub struct StaticFiles {
#[default = 1_000]
pub stream_threshold: usize,
#[default = 256]
pub stream_buffer: usize,
#[default = 128]
pub read_buffer: usize,
}