pub struct Template(/* private fields */);
Implementations§
Source§impl Template
impl Template
pub fn new() -> Self
pub fn sub_one<T>(self, placeholder: ID, replace_with: T) -> Self
pub fn sub_many(self, substitutions: &mut HashMap<ID, Template>) -> Self
pub fn sub<T>(self, placeholder: ID, replace_with: T) -> Substitution
pub fn iter(&self) -> Iter<'_, Data>
pub fn render(self) -> Result<Vec<u8>, Template>
pub fn indented(self, depth: usize) -> Self
pub fn line(self) -> Self
pub fn add<T>(self, component: T) -> Self
pub fn concat<T>(self, template: T) -> Self
Trait Implementations§
Source§impl From<Substitution> for Template
impl From<Substitution> for Template
Source§fn from(Substitution: Substitution) -> Template
fn from(Substitution: Substitution) -> Template
Converts to this type from the input type.
Source§impl FromIterator<Data> for Template
impl FromIterator<Data> for Template
Source§impl IntoIterator for Template
impl IntoIterator for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnwindSafe for Template
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