Struct minimad::TextTemplate[][src]

pub struct TextTemplate<'s> {
    pub text: Text<'s>,
    // some fields omitted
}
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

impl<'s> TextTemplate<'s>[src]

pub fn expander<'b>(&'b self) -> TextTemplateExpander<'s, 'b>[src]

return a new expander for the template

Trait Implementations

impl<'s> Debug for TextTemplate<'s>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'s, 'b> From<&'b TextTemplate<'s>> for TextTemplateExpander<'s, 'b>[src]

fn from(template: &'b TextTemplate<'s>) -> Self[src]

Build a new expander for the template. The expander stores the additions done with set, set_md, set_lines or in the sub expanders.

impl<'s> From<&'s str> for TextTemplate<'s>[src]

fn from(md: &'s str) -> TextTemplate<'s>[src]

build a template from a markdown text with placeholders like ${some-name} and sub-templates

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.