Struct handlebars::template::Template
source · [−]pub struct Template {
pub name: Option<String>,
pub elements: Vec<TemplateElement>,
pub mapping: Option<Vec<TemplateMapping>>,
}
Expand description
A handlebars template
Fields
name: Option<String>
elements: Vec<TemplateElement>
mapping: Option<Vec<TemplateMapping>>
Implementations
sourceimpl Template
impl Template
pub fn new(mapping: bool) -> Template
pub fn compile<S: AsRef<str>>(source: S) -> Result<Template, TemplateError>
pub fn compile2<'a, S: AsRef<str> + 'a>(
source: S,
mapping: bool
) -> Result<Template, TemplateError>
pub fn compile_with_name<S: AsRef<str>>(
source: S,
name: String,
mapping: bool
) -> Result<Template, TemplateError>
Trait Implementations
sourceimpl Evaluable for Template
impl Evaluable for Template
fn eval<'reg: 'rc, 'rc>(
&'reg self,
registry: &'reg Registry<'reg>,
ctx: &'rc Context,
rc: &mut RenderContext<'reg, 'rc>
) -> Result<(), RenderError>
sourceimpl Renderable for Template
impl Renderable for Template
sourcefn render<'reg: 'rc, 'rc>(
&'reg self,
registry: &'reg Registry<'reg>,
ctx: &'rc Context,
rc: &mut RenderContext<'reg, 'rc>,
out: &mut dyn Output
) -> Result<(), RenderError>
fn render<'reg: 'rc, 'rc>(
&'reg self,
registry: &'reg Registry<'reg>,
ctx: &'rc Context,
rc: &mut RenderContext<'reg, 'rc>,
out: &mut dyn Output
) -> Result<(), RenderError>
render into RenderContext’s writer
sourcefn renders<'reg: 'rc, 'rc>(
&'reg self,
registry: &'reg Registry<'reg>,
ctx: &'rc Context,
rc: &mut RenderContext<'reg, 'rc>
) -> Result<String, RenderError>
fn renders<'reg: 'rc, 'rc>(
&'reg self,
registry: &'reg Registry<'reg>,
ctx: &'rc Context,
rc: &mut RenderContext<'reg, 'rc>
) -> Result<String, RenderError>
render into string
impl StructuralPartialEq for Template
Auto Trait Implementations
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnwindSafe for Template
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more