impl {{struct_name}} { pub fn validate(&self) -> Result<(), &'static str> { {{#each fields}} {{#if is_string}} check_str_len(&self.{{name}}, {{max_len_const}})?;{{else}} {{check_call}}(&self.{{name}})?;{{/if}} {{/each}} Ok(()) } }