pub struct TemplateParameterizer { /* private fields */ }Expand description
Template parameterizer for applying parameters to templates.
Implementations§
Source§impl TemplateParameterizer
impl TemplateParameterizer
Sourcepub fn with_markers<S: Into<String>>(prefix: S, suffix: S) -> Self
pub fn with_markers<S: Into<String>>(prefix: S, suffix: S) -> Self
Create a parameterizer with custom placeholder markers.
Sourcepub fn apply_parameters(
&self,
template: &str,
params: &HashMap<String, ParameterValue>,
) -> Result<String>
pub fn apply_parameters( &self, template: &str, params: &HashMap<String, ParameterValue>, ) -> Result<String>
Apply parameters to a template string.
Sourcepub fn extract_placeholders(&self, template: &str) -> Vec<String>
pub fn extract_placeholders(&self, template: &str) -> Vec<String>
Extract placeholders from a template.
Sourcepub fn validate_coverage(
&self,
template: &str,
params: &HashMap<String, ParameterValue>,
) -> Result<()>
pub fn validate_coverage( &self, template: &str, params: &HashMap<String, ParameterValue>, ) -> Result<()>
Validate that all placeholders can be filled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TemplateParameterizer
impl RefUnwindSafe for TemplateParameterizer
impl Send for TemplateParameterizer
impl Sync for TemplateParameterizer
impl Unpin for TemplateParameterizer
impl UnsafeUnpin for TemplateParameterizer
impl UnwindSafe for TemplateParameterizer
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