pub struct Registry<'reg> {
pub env: Handlebars<'reg>,
pub content: HashMap<String, Vec<u8>>,
}Expand description
Registry with a cache for rendered item contents.
Fields
env: Handlebars<'reg>The templates before rendering.
content: HashMap<String, Vec<u8>>The rendered contents of items.
Trait Implementations
sourceimpl Register for Registry<'_>
impl Register for Registry<'_>
sourcefn register_helpers(self) -> Result<Self>
fn register_helpers(self) -> Result<Self>
Registers DT’s built-in helpers. Read more
sourcefn load(self, config: &DTConfig) -> Result<Self>
fn load(self, config: &DTConfig) -> Result<Self>
Load templates and render them into cached storage, items that are not
templated (see is_templated) will not be registered into templates
but directly stored into the rendered cache. Read more
sourcefn render<S: Serialize>(&self, name: &str, ctx: &Rc<S>) -> Result<Vec<u8>>
fn render<S: Serialize>(&self, name: &str, ctx: &Rc<S>) -> Result<Vec<u8>>
Returns the content of an item rendered with given rendering context. This does not modify the stored content. Read more
Auto Trait Implementations
impl<'reg> !RefUnwindSafe for Registry<'reg>
impl<'reg> Send for Registry<'reg>
impl<'reg> Sync for Registry<'reg>
impl<'reg> Unpin for Registry<'reg>
impl<'reg> !UnwindSafe for Registry<'reg>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more