protovalidate-buffa 0.3.0

Runtime for protoc-gen-protovalidate-buffa — Validate trait, ValidationError types, rule helpers, and the CelScalar / Duration / Timestamp helpers that compile-time-expanded CEL rules call into. No CEL interpreter at runtime.
Documentation

Runtime companion for protoc-gen-protovalidate-buffa.

Provides the [Validate] trait, the [ValidationError] / [Violation] / [FieldPath] types returned from generated validate() methods, the [cel] module of thin helpers that compile-time-expanded CEL rules call into (scalar widening, Duration/Timestamp converters, now), and the [rules] module of pure-Rust helpers used by generated code (UUID / ULID / IP / URI / hostname checks and friends, mostly thin wrappers over uuid, ulid, ipnet, and fluent-uri).

There is no CEL interpreter at runtime: the paired protoc-gen-protovalidate-buffa plugin transpiles every CEL rule to native Rust at codegen time. Generated validate() methods are direct field-access checks with zero per-call Value / HashMap allocations.

[ValidationError] carries three orthogonal signals:

  • violations: list of per-field rule failures (the common case).
  • compile_error: non-empty when the codegen plugin detected a schema-level mismatch (rule type / field type, duplicate / unknown fields in message.oneof, CEL referencing a non-existent field).
  • runtime_error: non-empty when a rule's precondition could not be evaluated (e.g. bytes.pattern on non-UTF-8 input, or a CEL rule that compiled-time analysis flagged as always-runtime-error such as dyn(this).<unknown_field>).

The full upstream protovalidate-conformance suite (2872 cases, covering proto2, proto3, and editions 2023) passes against code emitted by the paired plugin.