protocheck/
lib.rs

1#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2#![doc = include_str!("../README.md")]
3//! # Feature flags
4#![doc = document_features::document_features!()]
5
6pub mod types {
7  pub use proto_types::*;
8}
9
10/// The shared trait for all structs that have validators in them. The `validate` method is available on the structs themselves, so it is not necessary to import the trait just for validation, but this is useful for making functions that accept any struct implementing ProtoValidator, such as a Tower layer.
11pub trait ProtoValidator {
12  /// The method that performs validation on the message struct.
13  /// This is available on the generated structs on its own, so you don't need to import the trait unless you want to use it with a generic.
14  fn validate(&self) -> Result<(), Violations>;
15}
16
17use proto_types::protovalidate::Violations;
18pub use protocheck_core::*;
19#[doc(inline)]
20pub use protocheck_proc_macro as macros;