MCPcopy Index your code
hub / github.com/eventuallyconsultant/codegenr / HandlebarsExt

Interface HandlebarsExt

codegenr/src/helpers/handlebars_ext.rs:4–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2use serde_json::Value;
3
4pub trait HandlebarsExt {
5 fn ensure_arguments_count(&self, count: usize, helper_name: &str) -> HelperResult;
6 fn ensure_arguments_count_max(&self, count: usize, helper_name: &str) -> HelperResult;
7 fn ensure_arguments_count_min(&self, count: usize, helper_name: &str) -> HelperResult;
8 fn get_param_as_str(&self, index: usize) -> Option<&str>;
9 fn get_param_as_str_or_fail(&self, index: usize, helper_name: &str) -> Result<&str, RenderError>;
10 fn get_param_as_json(&self, index: usize) -> Option<&Value>;
11 fn get_param_as_json_or_fail(&self, index: usize, helper_name: &str) -> Result<&Value, RenderError>;
12 fn get_param_as_array(&self, index: usize) -> Option<&Vec<Value>>;
13 fn get_param_as_array_or_fail(&self, index: usize, helper_name: &str) -> Result<&Vec<Value>, RenderError>;
14 fn get_param_as_bool(&self, index: usize) -> Option<bool>;
15 fn get_param_as_bool_or_fail(&self, index: usize, helper_name: &str) -> Result<bool, RenderError>;
16 fn get_param_as_integer(&self, index: usize) -> Option<u64>;
17}
18
19impl<'reg, 'rc> HandlebarsExt for Helper<'reg, 'rc> {
20 fn ensure_arguments_count(&self, count: usize, helper_name: &str) -> HelperResult {

Callers

nothing calls this directly

Implementers 1

handlebars_ext.rscodegenr/src/helpers/handlebars_ext.rs

Calls

no outgoing calls

Tested by

no test coverage detected