Skip to main content

Module validators

Module validators 

Source

Re-exports§

pub use any::*;
pub use bool::*;
pub use bytes::*;
pub use duration::*;
pub use enums::*;
pub use map::*;
pub use message::*;
pub use repeated::*;
pub use string::*;
pub use timestamp::*;
pub use floats::*;
pub use integers::*;
pub use field_mask::*;

Modules§

any
bool
bytes
duration
enums
field_mask
floats
integers
map
message
repeated
string
timestamp

Structs§

CelProgram
A struct that holds the data to initialize and execute a CEL program. It can be created from a CelRule.
CelRule
A rule that defines CEL-based validation
FailFast
Unit struct to signal the fail fast setting and trigger early returns with ValidationResult.
FieldContext
The context for the field being validated.
FnValidator
Implements Validator for the wrapped function, similarly to FromFn.
IntoIter
Owned iterator for ViolationCtx.
Iter
Ref iterator for ViolationCtx.
IterMut
Mutable ref iterator for ViolationCtx.
OneofValidator
OneofValidatorBuilder
Builder for OneofValidator.
SortedList
Holds a static list of immutable, sorted values.
ValidationCtx
The context for a given validation execution.
ValidationErrors
Holds the rich context concerning the validation errors that occur during validation.
ViolationCtx
The context of a specific violation.
ViolationCtxMut
Mutable view for ViolationCtx.
ViolationCtxRef
Immutable view for ViolationCtx.
ViolationMeta
Offers information about the subject of the violation: the violation kind (string, int32, bytes, etc) and the field kind (map key, map value, etc).

Enums§

CelErrorcel
Represents runtime errors that can occur with CEL programs.
FieldKind
Specifies whether the target of the validation is a field/element as a whole, a value or key in a map field, or an item in a repeated field.
IsValid
A boolean-like enum that represents validation status. It supports all of the bit operators.

Traits§

CelOneofcel
A trait that enables conversion into cel::Value.
CelValuecel
A trait that enables conversion into cel::Value.
IntoSortedList
Utility trait to convert a sortable list into a SortedList.
ProtoValidation
Trait implemented by targets of proto validators.
ValidationResultExt
Utility sealed trait for ValidationResult that makes it easier to discern the validation status.
Validator
The trait implemented by the validators, which can be structs or functions used with FnValidator.
ValidatorBuilderFor
Utility trait for validator builders. Mainly used for default validators.

Functions§

from_fn
Creates a validator from a function, using FnValidator.

Type Aliases§

ValidationResult
Alias for Result<IsValid, FailFast>.