mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-04-03 21:00:44 +02:00
10 lines
326 B
Rust
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(())
|
|
}
|
|
|