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