pub struct Template<P> { /* private fields */ }Expand description
Parsed template string with typed placeholders.
Implementations§
Source§impl<P> Template<P>where
P: Placeholder,
impl<P> Template<P>where
P: Placeholder,
Sourcepub fn render_with<F, E>(&self, render: F) -> Result<String, TemplateError>
pub fn render_with<F, E>(&self, render: F) -> Result<String, TemplateError>
Render the template using a placeholder renderer callback.
Source§impl<P> Template<P>where
P: Placeholder,
impl<P> Template<P>where
P: Placeholder,
Sourcepub fn parse(value: &str, placeholders: &[P]) -> Result<Self, TemplateError>
pub fn parse(value: &str, placeholders: &[P]) -> Result<Self, TemplateError>
Parse a template string and reject unknown placeholders.
Sourcepub fn parts(&self) -> &[TemplatePart<P>]
pub fn parts(&self) -> &[TemplatePart<P>]
Return parsed template parts.
Trait Implementations§
impl<P: Eq> Eq for Template<P>
impl<P: PartialEq> StructuralPartialEq for Template<P>
Auto Trait Implementations§
impl<P> Freeze for Template<P>
impl<P> RefUnwindSafe for Template<P>where
P: RefUnwindSafe,
impl<P> Send for Template<P>where
P: Send,
impl<P> Sync for Template<P>where
P: Sync,
impl<P> Unpin for Template<P>where
P: Unpin,
impl<P> UnsafeUnpin for Template<P>
impl<P> UnwindSafe for Template<P>where
P: UnwindSafe,
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