Enum iron_tera::TemplateMode
source · Expand description
There are 2 main ways to pass data to generate a template.
Variants
TeraContext(Context)
TeraContext constructor takes a Context
Serialized(Value)
Serialized constructor takes a Value
from serde_json
Implementations
sourceimpl TemplateMode
impl TemplateMode
TemplateMode should only ever be created from these smart constructors, not with the enums type constructors.
pub fn from_context(context: Context) -> TemplateMode
pub fn from_serial<S: Serialize>(
serializeable: S
) -> Result<TemplateMode, TemplateError>
Trait Implementations
sourceimpl Clone for TemplateMode
impl Clone for TemplateMode
sourcefn clone(&self) -> TemplateMode
fn clone(&self) -> TemplateMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for TemplateMode
impl Debug for TemplateMode
sourceimpl From<Context> for TemplateMode
impl From<Context> for TemplateMode
Auto Trait Implementations
impl RefUnwindSafe for TemplateMode
impl Send for TemplateMode
impl Sync for TemplateMode
impl Unpin for TemplateMode
impl UnwindSafe for TemplateMode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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