1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Runtime companion for `protoc-gen-protovalidate-buffa`.
//!
//! Provides the [`Validate`] trait, the [`ValidationError`] /
//! [`Violation`] / [`FieldPath`] types returned from generated
//! `validate()` methods, the [`cel`] module that backs message-level
//! and field-level CEL rules, 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`).
//!
//! [`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, CEL type
//! mismatch).
//!
//! The full upstream `protovalidate-conformance` suite (2872 cases,
//! covering proto2, proto3, and editions 2023) passes against code
//! emitted by the paired plugin.
// Re-export external crates referenced by plugin-generated code so that
// downstream crates only need to depend on `protovalidate-buffa` and not on
// `regex` / `cel-interpreter` / `buffa` directly.
pub use buffa;
pub use cel_interpreter;
pub use ;
/// `#[connect_impl]` — attribute macro applied to a Connect service `impl`
/// block that inserts `req.validate()?` at the top of every handler method.
/// Guarantees protovalidate runs for every RPC without relying on per-handler
/// discipline.
pub use connect_impl;
pub use regex;