| 2 | use serde_json::Value; |
| 3 | |
| 4 | pub 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 | |
| 19 | impl<'reg, 'rc> HandlebarsExt for Helper<'reg, 'rc> { |
| 20 | fn ensure_arguments_count(&self, count: usize, helper_name: &str) -> HelperResult { |
nothing calls this directly
no outgoing calls
no test coverage detected