use crate::templates::Templates; use crate::Besult; use std::sync::Arc; #[derive(Clone)] pub struct State { pub templates: Arc, } impl State { pub async fn try_new() -> Besult { let templates = Arc::new(Templates::try_load("src/templates").await?); Ok(Self { templates }) } }