Skip to main content

Module bridge

Module bridge 

Source
Expand description

Runtime bridge for validating wire-encoded messages through the descriptor-driven Validator.

Used by prost-protovalidate-build’s runtime_bridge codegen mode (buffa backend): messages whose rules the compile-time generator cannot cover (CEL, predefined CEL, or shapes routed to the runtime) get an impl Validate that encodes the message to protobuf wire bytes and delegates here, reusing the full runtime engine — including the CEL interpreter — instead of a second validation code path. Standard-only messages keep their inline generated validators; only routed messages reach this bridge.

Reflection-gated: available only with the reflect feature (implied by cel). CEL rules additionally require cel.

The generated code references only this module’s public surface (::prost_protovalidate::bridge::*), so a consumer needs no direct dependency on prost-reflect.

Structs§

RuntimeBridge
A descriptor pool plus a Validator, built once from an embedded FileDescriptorSet and reused across validations.

Functions§

error_to_validation_error
Collapse a runtime Error into the ValidationError the Validate trait returns.