1#[cfg(feature = "bincode")]
2#[cfg(feature = "std")]
3mod bin_code;
4
5#[cfg(feature = "bincode")]
6pub(crate) mod bin_code_nostd;
7
8mod from_slice;
9mod lookup_value;
10mod ordered_map;
11
12#[cfg(feature = "std")]
13mod std_impl;
14
15use alloc::collections::BTreeMap;
16
17pub use compact_str::CompactString as MiniStr;
21#[cfg(feature = "std")]
23pub use kstring::KString;
24
25use crate::template::Template;
26
27#[cfg(feature = "std")]
28pub type AHashRawMap = ahash::HashMap<KString, MiniStr>;
29
30pub type BTreeRawMap = BTreeMap<MiniStr, MiniStr>;
31
32#[cfg(feature = "std")]
33pub type AST = ahash::HashMap<KString, Template>;
34
35#[cfg(feature = "std")]
36pub type OrderedAST = BTreeMap<KString, Template>;
37
38#[cfg(not(feature = "std"))]
39pub type OrderedAST = BTreeMap<MiniStr, Template>;
40
41#[cfg(not(feature = "std"))]
42pub type AST = OrderedAST;
43
44#[derive(Default, Debug, Clone, PartialEq)]
53#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
54pub struct Resolver(pub AST);
55
56impl core::ops::Deref for Resolver {
57 type Target = AST;
58
59 fn deref(&self) -> &Self::Target {
60 &self.0
61 }
62}