lyrs/src/state.rs

17 lines
324 B
Rust
Raw Normal View History

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