Struct fv_template::rt::Template
source · pub struct Template<'a>(pub &'a [Part<'a>]);Expand description
A runtime field-value template.
Tuple Fields§
§0: &'a [Part<'a>]Implementations§
source§impl<'a> Template<'a>
impl<'a> Template<'a>
sourcepub fn render<'brw>(
&'brw self,
ctx: Context<impl Fn(&mut Formatter<'_>, &str) -> Option<Result> + 'brw, impl Fn(&mut Formatter<'_>, &str) -> Result + 'brw>
) -> impl Display + 'brw
pub fn render<'brw>( &'brw self, ctx: Context<impl Fn(&mut Formatter<'_>, &str) -> Option<Result> + 'brw, impl Fn(&mut Formatter<'_>, &str) -> Result + 'brw> ) -> impl Display + 'brw
Render the template using the given context.
The context helps the template find replacement values and determines how to render them if they’re missing. An empty context can be used to render out the template with just its holes.
Trait Implementations§
source§impl<'a> PartialEq<Template<'a>> for Template<'a>
impl<'a> PartialEq<Template<'a>> for Template<'a>
impl<'a> Copy for Template<'a>
impl<'a> Eq for Template<'a>
impl<'a> StructuralEq for Template<'a>
impl<'a> StructuralPartialEq for Template<'a>
Auto Trait Implementations§
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