Registry

Struct Registry 

Source
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§

Source§

impl<'reg> Debug for Registry<'reg>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'reg> Default for Registry<'reg>

Source§

fn default() -> Registry<'reg>

Returns the “default value” for a type. Read more
Source§

impl Register for Registry<'_>

Source§

fn register_helpers(self) -> Result<Self>

Registers DT’s built-in helpers.
Source§

fn load(self, config: &DTConfig) -> Result<Self>

Load templates and render them into cached storage, items that are not templated (see renderable) will not be registered into templates but directly stored into the rendered cache.
Source§

fn update<S: Serialize>(&mut self, name: &str, ctx: &S) -> Result<()>

Renders the template addressed by name and store the rendered content into cache. Read more
Source§

fn get(&self, name: &str) -> Result<Vec<u8>>

Looks up the rendered content of an item with given name.

Auto Trait Implementations§

§

impl<'reg> Freeze for Registry<'reg>

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,