protify 0.1.4

A Rust-first protobuf framework to generate packages from rust code, with validation included
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% macro render_field(field, package, indent) %}
  {{+ field.type_.render(package) +}} {{+ field.name +}} = {{+ field.tag }}
  {% filter indent(indent) %}
  {%+ if !field.options.is_empty() || !field.validators.is_empty() +%} [
  {% for option in field.options_with_validators() +%}
  {{+ option.name +}} = {{+ option.value | indent(2) +}}{% if !loop.last %},{% endif ~%}
  {% endfor +%}
] {%- endif -%};
  {% endfilter +%}
{% endmacro %}

{% macro empty_line_if(condition) %}
{% if condition %}
{{ "\n" }}  
{% endif %}  
{% endmacro %}