Struct minimad::TextTemplate
source · pub struct TextTemplate<'s> {
pub text: Text<'s>,
/* private fields */
}
Expand description
a markdown template allowing you to replace some placeholders with given values, or to expand some sub-templates with repetitions (useful with lists, table rows, etc.)
Fields§
§text: Text<'s>
Implementations§
source§impl<'s> TextTemplate<'s>
impl<'s> TextTemplate<'s>
sourcepub fn expander<'b>(&'b self) -> TextTemplateExpander<'s, 'b>
pub fn expander<'b>(&'b self) -> TextTemplateExpander<'s, 'b>
return a new expander for the template
Trait Implementations§
source§impl<'s> Debug for TextTemplate<'s>
impl<'s> Debug for TextTemplate<'s>
source§impl<'s, 'b> From<&'b TextTemplate<'s>> for TextTemplateExpander<'s, 'b>
impl<'s, 'b> From<&'b TextTemplate<'s>> for TextTemplateExpander<'s, 'b>
source§fn from(template: &'b TextTemplate<'s>) -> Self
fn from(template: &'b TextTemplate<'s>) -> Self
Build a new expander for the template. The expander stores the additions
done with set
, set_md
, set_lines
or in the sub
expanders.
source§impl<'s> From<&'s str> for TextTemplate<'s>
impl<'s> From<&'s str> for TextTemplate<'s>
source§fn from(md: &'s str) -> TextTemplate<'s>
fn from(md: &'s str) -> TextTemplate<'s>
build a template from a markdown text with placeholders like ${some-name} and sub-templates
Auto Trait Implementations§
impl<'s> Freeze for TextTemplate<'s>
impl<'s> RefUnwindSafe for TextTemplate<'s>
impl<'s> Send for TextTemplate<'s>
impl<'s> Sync for TextTemplate<'s>
impl<'s> Unpin for TextTemplate<'s>
impl<'s> UnwindSafe for TextTemplate<'s>
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