trillium_handlebars/
assigns.rs1use serde::Serialize;
2use serde_json::Value;
3use std::{
4 borrow::Cow,
5 collections::HashMap,
6 ops::{Deref, DerefMut},
7};
8
9#[derive(Default, Serialize, Debug)]
14pub struct Assigns(HashMap<Cow<'static, str>, Value>);
15
16impl Deref for Assigns {
17 type Target = HashMap<Cow<'static, str>, Value>;
18
19 fn deref(&self) -> &Self::Target {
20 &self.0
21 }
22}
23
24impl DerefMut for Assigns {
25 fn deref_mut(&mut self) -> &mut Self::Target {
26 &mut self.0
27 }
28}