pub fn set_up_validators(
config: &mut Config,
files: &[impl AsRef<Path>],
include_paths: &[impl AsRef<Path>],
packages: &[&str],
) -> Result<DescriptorData, Box<dyn Error>>Expand description
Sets up the validators defined via protovalidate annotations in the target packages, and returns an empty DescriptorData instance.
If you wish to collect data from the descriptor while setting up the validators, look into the DescriptorDataConfig struct.
All of the selected messages will implement ValidatedMessage, the selected enums will implement ProtoEnum, and the selected oneofs will implement ValidatedOneof, and all of them will implement ProtoValidation.
If the cel feature is enabled, CelValue and CelOneof will also be implemented for messages and oneofs.
Just like the non-reflection-based version of this crate, this will also automatically generate a check_validators method on each message and oneof, as well as a test that automatically calls this method and panics on failure, in order to ensure that validators represent valid configurations.
Should you wish to disable these checks, you can disable them with the skip_checks(validators) attribute, which you can easily set up programmatically by taking advantage of the data collection performed by the DescriptorDataConfig struct.