[−][src]Struct asciii::templater::Templater
Simple templating module
Fields
original: String
content of template file after reading
filled: String
content of filled template
Methods
impl Templater
[src]
impl Templater
pub fn new(template: &str) -> Templater
[src]
pub fn new(template: &str) -> Templater
pub fn from_file(path: &Path) -> Result<Templater, Error>
[src]
pub fn from_file(path: &Path) -> Result<Templater, Error>
pub fn finalize(&mut self) -> Templater
[src]
pub fn finalize(&mut self) -> Templater
pub fn complete(&mut self) -> TemplateResult<Templater>
[src]
pub fn complete(&mut self) -> TemplateResult<Templater>
Creates a finished version of the output.
If any keywords remain unfilled, Err
contains a list of left overs.
pub fn fix(&self) -> Self
[src]
pub fn fix(&self) -> Self
pub fn fill_in_field(&mut self, field: &str, value: &str) -> &mut Templater
[src]
pub fn fill_in_field(&mut self, field: &str, value: &str) -> &mut Templater
pub fn fill_in_data(&mut self, data: &HashMap<&str, String>) -> &mut Templater
[src]
pub fn fill_in_data(&mut self, data: &HashMap<&str, String>) -> &mut Templater
pub fn list_keywords(&self) -> Vec<String>
[src]
pub fn list_keywords(&self) -> Vec<String>
pub fn fill_template<F>(&mut self, closure: F) -> &mut Templater where
F: Fn(&str) -> String,
[src]
pub fn fill_template<F>(&mut self, closure: F) -> &mut Templater where
F: Fn(&str) -> String,
Trait Implementations
impl ToOwned for Templater
[src]
impl ToOwned for Templater
type Owned = Templater
fn to_owned(&self) -> Templater
[src]
fn to_owned(&self) -> Templater
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut Self::Owned)
[src]
fn clone_into(&self, target: &mut Self::Owned)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl Debug for Templater
[src]
impl Debug for Templater
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more