pub struct Template<'a> { /* private fields */ }Expand description
A parsed template that can be rendered multiple times efficiently
Implementations§
Source§impl<'a> Template<'a>
impl<'a> Template<'a>
Sourcepub fn render(
&self,
registry: &ModuleRegistry,
context: &ModuleContext,
) -> Result<String>
pub fn render( &self, registry: &ModuleRegistry, context: &ModuleContext, ) -> Result<String>
Render the template with the given registry and context
Sourcepub fn tokens(&self) -> impl Iterator<Item = &Token<'a>>
pub fn tokens(&self) -> impl Iterator<Item = &Token<'a>>
Get an iterator over the tokens in this template
Sourcepub fn token_count(&self) -> usize
pub fn token_count(&self) -> usize
Get the number of tokens in this template
Auto Trait Implementations§
impl<'a> Freeze for Template<'a>
impl<'a> RefUnwindSafe for Template<'a>
impl<'a> Send for Template<'a>
impl<'a> Sync for Template<'a>
impl<'a> Unpin for Template<'a>
impl<'a> UnwindSafe for Template<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more