[−][src]Struct bracket::template::Templates
Collection of named templates.
For partials to be resolved they must exist in a collection that is used during a render.
Implementations
impl<'source> Templates<'source>[src]
pub fn new() -> Self[src]
Create an empty templates collection.
pub fn insert(&mut self, name: &str, template: Template<'source>)[src]
Add a named template.
If a template already exists with the given name it is overwritten.
pub fn remove(&mut self, name: &'source str) -> Option<Template<'source>>[src]
Remove a named template.
pub fn get(&self, name: &str) -> Option<&Template<'source>>[src]
Get a named template from this collection.
pub fn compile(s: &str, options: ParserOptions) -> Result<Template<'_>>[src]
Compile a string to a template.
Trait Implementations
impl<'source> Default for Templates<'source>[src]
impl<'reg, 'source> From<Templates<'source>> for Registry<'reg, 'source>[src]
Create a registry using a collection of templates.
Auto Trait Implementations
impl<'source> RefUnwindSafe for Templates<'source>
impl<'source> Send for Templates<'source>
impl<'source> Sync for Templates<'source>
impl<'source> Unpin for Templates<'source>
impl<'source> UnwindSafe for Templates<'source>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,