tek/src/view.rs
okay stopped screaming 244e2b388e wip: nomralize
2026-03-21 23:29:20 +02:00

10 lines
326 B
Rust

use crate::*;
/// Collection of view definitions.
pub type Views = Arc<RwLock<BTreeMap<Arc<str>, Arc<str>>>>;
pub(crate) fn load_view (views: &Views, name: &impl AsRef<str>, body: &impl Language) -> Usually<()> {
views.write().unwrap().insert(name.as_ref().into(), body.src()?.unwrap_or_default().into());
Ok(())
}