Files
xmpd/xmpd-settings/src/cache.rs
MCorange a21295ecc8 Major update
too lazy to describe
2025-12-07 19:46:47 +02:00

30 lines
704 B
Rust

use camino::Utf8PathBuf;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Cache {
#[serde(default="Cache::default_cache_path")]
pub cache_path: Utf8PathBuf,
#[serde(default="Cache::default_manifest_path")]
pub manifest_path: Utf8PathBuf,
}
impl Default for Cache {
fn default() -> Self {
Self {
cache_path: Self::default_cache_path(),
manifest_path: Self::default_manifest_path(),
}
}
}
impl Cache {
fn default_cache_path() -> Utf8PathBuf {
Utf8PathBuf::from("./cache")
}
fn default_manifest_path() -> Utf8PathBuf {
Utf8PathBuf::from("./manifest.json")
}
}