Skip to main content

Module protovalidate

Module protovalidate 

Source
Available on crate feature protovalidate only.
Expand description

Generated rust code from buf.validate protobuf package, with some added methods and structs.

Modules§

any_violations
base_violations
bytes_rules
Nested message and enum types in BytesRules.
bytes_violations
double_rules
Nested message and enum types in DoubleRules.
duration_rules
Nested message and enum types in DurationRules.
duration_violations
enum_violations
field_mask_violations
field_path_element
Nested message and enum types in FieldPathElement.
field_rules
Nested message and enum types in FieldRules.
fixed32_rules
Nested message and enum types in Fixed32Rules.
fixed64_rules
Nested message and enum types in Fixed64Rules.
float_rules
Nested message and enum types in FloatRules.
float_violations
int32_rules
Nested message and enum types in Int32Rules.
int64_rules
Nested message and enum types in Int64Rules.
int_violations
map_violations
oneof_violations
repeated_violations
s_fixed32_rules
Nested message and enum types in SFixed32Rules.
s_fixed64_rules
Nested message and enum types in SFixed64Rules.
s_int32_rules
Nested message and enum types in SInt32Rules.
s_int64_rules
Nested message and enum types in SInt64Rules.
string_rules
Nested message and enum types in StringRules.
string_violations
timestamp_rules
Nested message and enum types in TimestampRules.
timestamp_violations
u_int32_rules
Nested message and enum types in UInt32Rules.
u_int64_rules
Nested message and enum types in UInt64Rules.
violations_data

Structs§

AnyRules
AnyRules describe rules applied exclusively to the google.protobuf.Any well-known type.
BoolRules
BoolRules describes the rules applied to bool values. These rules may also be applied to the google.protobuf.BoolValue Well-Known-Type.
BytesRules
BytesRules describe the rules applied to bytes values. These rules may also be applied to the google.protobuf.BytesValue Well-Known-Type.
ConstPathElement
Struct that can map to a FieldPathElement with const-compatible values.
DoubleRules
DoubleRules describes the rules applied to double values. These rules may also be applied to the google.protobuf.DoubleValue Well-Known-Type.
DurationRules
DurationRules describe the rules applied exclusively to the google.protobuf.Duration well-known type.
EnumRules
EnumRules describe the rules applied to enum values.
FieldMaskRules
FieldMaskRules describe rules applied exclusively to the google.protobuf.FieldMask well-known type.
FieldPath
FieldPath provides a path to a nested protobuf field.
FieldPathElement
FieldPathElement provides enough information to nest through a single protobuf field.
FieldRules
FieldRules encapsulates the rules for each type of field. Depending on the field, the correct set should be used to ensure proper validations.
Fixed32Rules
Fixed32Rules describes the rules applied to fixed32 values.
Fixed64Rules
Fixed64Rules describes the rules applied to fixed64 values.
FloatRules
FloatRules describes the rules applied to float values. These rules may also be applied to the google.protobuf.FloatValue Well-Known-Type.
Int32Rules
Int32Rules describes the rules applied to int32 values. These rules may also be applied to the google.protobuf.Int32Value Well-Known-Type.
Int64Rules
Int64Rules describes the rules applied to int64 values. These rules may also be applied to the google.protobuf.Int64Value Well-Known-Type.
MapRules
MapRules describe the rules applied to map values.
MessageOneofRule
MessageRules
MessageRules represents validation rules that are applied to the entire message. It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules.
OneofRules
The OneofRules message type enables you to manage rules for oneof fields in your protobuf messages.
PredefinedRules
PredefinedRules are custom rules that can be re-used with multiple fields.
RepeatedRules
RepeatedRules describe the rules applied to repeated values.
Rule
Rule represents a validation rule written in the Common Expression Language (CEL) syntax. Each Rule includes a unique identifier, an optional error message, and the CEL expression to evaluate. For more information, see our documentation.
SFixed32Rules
SFixed32Rules describes the rules applied to fixed32 values.
SFixed64Rules
SFixed64Rules describes the rules applied to fixed64 values.
SInt32Rules
SInt32Rules describes the rules applied to sint32 values.
SInt64Rules
SInt64Rules describes the rules applied to sint64 values.
StringRules
StringRules describes the rules applied to string values These rules may also be applied to the google.protobuf.StringValue Well-Known-Type.
TimestampRules
TimestampRules describe the rules applied exclusively to the google.protobuf.Timestamp well-known type.
UInt32Rules
UInt32Rules describes the rules applied to uint32 values. These rules may also be applied to the google.protobuf.UInt32Value Well-Known-Type.
UInt64Rules
UInt64Rules describes the rules applied to uint64 values. These rules may also be applied to the google.protobuf.UInt64Value Well-Known-Type.
Violation
Violation represents a single instance where a validation rule, expressed as a Rule, was not met. It provides information about the field that caused the violation, the specific rule that wasn’t fulfilled, and a human-readable error message.
ViolationData
The name and path elements associated with a given violation.
Violations
Violations is a collection of Violation messages. This message type is returned by Protovalidate when a proto message fails to meet the requirements set by the Rule validation rules. Each individual violation is represented by a Violation message.

Enums§

AnyViolation
All types of violations for any fields.
BoolViolation
All types of violations for bool fields.
BytesViolation
All types of violations for bytes fields.
DoubleViolation
All types of violations for double fields.
DurationViolation
All types of violations for duration fields.
EnumViolation
All types of violations for enum fields.
FieldMaskViolation
All types of violations for field_mask fields.
Fixed32Violation
All types of violations for fixed32 fields.
Fixed64Violation
All types of violations for fixed64 fields.
FloatViolation
All types of violations for float fields.
Ignore
Specifies how FieldRules.ignore behaves, depending on the field’s value, and whether the field tracks presence.
Int32Violation
All types of violations for int32 fields.
Int64Violation
All types of violations for int64 fields.
KnownRegex
KnownRegex contains some well-known patterns.
MapViolation
All types of violations for map fields.
RepeatedViolation
All types of violations for repeated fields.
Sfixed32Violation
All types of violations for sfixed32 fields.
Sfixed64Violation
All types of violations for sfixed64 fields.
Sint32Violation
All types of violations for sint32 fields.
Sint64Violation
All types of violations for sint64 fields.
StringViolation
All types of violations for string fields.
TimestampViolation
All types of violations for timestamp fields.
Uint32Violation
All types of violations for uint32 fields.
Uint64Violation
All types of violations for uint64 fields.
ViolationKind
All types of violation from protovalidate rules.

Constants§

ANY_IN_VIOLATION
The data for the any.in violation.
ANY_NOT_IN_VIOLATION
The data for the any.not_in violation.
BOOL_CONST_VIOLATION
The data for the bool.const violation.
BYTES_CONST_VIOLATION
The data for the bytes.const violation.
BYTES_CONTAINS_VIOLATION
The data for the bytes.contains violation.
BYTES_IN_VIOLATION
The data for the bytes.in violation.
BYTES_IPV4_VIOLATION
The data for the bytes.ipv4 violation.
BYTES_IPV6_VIOLATION
The data for the bytes.ipv6 violation.
BYTES_IP_VIOLATION
The data for the bytes.ip violation.
BYTES_LEN_VIOLATION
The data for the bytes.len violation.
BYTES_MAX_LEN_VIOLATION
The data for the bytes.max_len violation.
BYTES_MIN_LEN_VIOLATION
The data for the bytes.min_len violation.
BYTES_NOT_IN_VIOLATION
The data for the bytes.not_in violation.
BYTES_PATTERN_VIOLATION
The data for the bytes.pattern violation.
BYTES_PREFIX_VIOLATION
The data for the bytes.prefix violation.
BYTES_SUFFIX_VIOLATION
The data for the bytes.suffix violation.
BYTES_UUID_VIOLATION
The data for the bytes.uuid violation.
CEL_VIOLATION
Data for the cel violation.
DOUBLE_CONST_VIOLATION
The data for the double.const violation.
DOUBLE_FINITE_VIOLATION
The data for the double.finite violation.
DOUBLE_GTE_VIOLATION
The data for the double.gte violation.
DOUBLE_GT_VIOLATION
The data for the double.gt violation.
DOUBLE_IN_VIOLATION
The data for the double.in violation.
DOUBLE_LTE_VIOLATION
The data for the double.lte violation.
DOUBLE_LT_VIOLATION
The data for the double.lt violation.
DOUBLE_NOT_IN_VIOLATION
The data for the double.not_in violation.
DURATION_CONST_VIOLATION
The data for the duration.const violation.
DURATION_GTE_VIOLATION
The data for the duration.gte violation.
DURATION_GT_VIOLATION
The data for the duration.gt violation.
DURATION_IN_VIOLATION
The data for the duration.in violation.
DURATION_LTE_VIOLATION
The data for the duration.lte violation.
DURATION_LT_VIOLATION
The data for the duration.lt violation.
DURATION_NOT_IN_VIOLATION
The data for the duration.not_in violation.
ENUM_CONST_VIOLATION
The data for the enum.const violation.
ENUM_DEFINED_ONLY_VIOLATION
The data for the enum.defined_only violation.
ENUM_IN_VIOLATION
The data for the enum.in violation.
ENUM_NOT_IN_VIOLATION
The data for the enum.not_in violation.
FIELD_MASK_CONST_VIOLATION
The data for the field_mask.const violation.
FIELD_MASK_IN_VIOLATION
The data for the field_mask.in violation.
FIELD_MASK_NOT_IN_VIOLATION
The data for the field_mask.not_in violation.
FIXED32_CONST_VIOLATION
The data for the fixed32.const violation.
FIXED32_GTE_VIOLATION
The data for the fixed32.gte violation.
FIXED32_GT_VIOLATION
The data for the fixed32.gt violation.
FIXED32_IN_VIOLATION
The data for the fixed32.in violation.
FIXED32_LTE_VIOLATION
The data for the fixed32.lte violation.
FIXED32_LT_VIOLATION
The data for the fixed32.lt violation.
FIXED32_NOT_IN_VIOLATION
The data for the fixed32.not_in violation.
FIXED64_CONST_VIOLATION
The data for the fixed64.const violation.
FIXED64_GTE_VIOLATION
The data for the fixed64.gte violation.
FIXED64_GT_VIOLATION
The data for the fixed64.gt violation.
FIXED64_IN_VIOLATION
The data for the fixed64.in violation.
FIXED64_LTE_VIOLATION
The data for the fixed64.lte violation.
FIXED64_LT_VIOLATION
The data for the fixed64.lt violation.
FIXED64_NOT_IN_VIOLATION
The data for the fixed64.not_in violation.
FLOAT_CONST_VIOLATION
The data for the float.const violation.
FLOAT_FINITE_VIOLATION
The data for the float.finite violation.
FLOAT_GTE_VIOLATION
The data for the float.gte violation.
FLOAT_GT_VIOLATION
The data for the float.gt violation.
FLOAT_IN_VIOLATION
The data for the float.in violation.
FLOAT_LTE_VIOLATION
The data for the float.lte violation.
FLOAT_LT_VIOLATION
The data for the float.lt violation.
FLOAT_NOT_IN_VIOLATION
The data for the float.not_in violation.
INT32_CONST_VIOLATION
The data for the int32.const violation.
INT32_GTE_VIOLATION
The data for the int32.gte violation.
INT32_GT_VIOLATION
The data for the int32.gt violation.
INT32_IN_VIOLATION
The data for the int32.in violation.
INT32_LTE_VIOLATION
The data for the int32.lte violation.
INT32_LT_VIOLATION
The data for the int32.lt violation.
INT32_NOT_IN_VIOLATION
The data for the int32.not_in violation.
INT64_CONST_VIOLATION
The data for the int64.const violation.
INT64_GTE_VIOLATION
The data for the int64.gte violation.
INT64_GT_VIOLATION
The data for the int64.gt violation.
INT64_IN_VIOLATION
The data for the int64.in violation.
INT64_LTE_VIOLATION
The data for the int64.lte violation.
INT64_LT_VIOLATION
The data for the int64.lt violation.
INT64_NOT_IN_VIOLATION
The data for the int64.not_in violation.
MAP_KEYS_VIOLATION
The data for the map.keys violation.
MAP_MAX_PAIRS_VIOLATION
The data for the map.max_pairs violation.
MAP_MIN_PAIRS_VIOLATION
The data for the map.min_pairs violation.
MAP_VALUES_VIOLATION
The data for the map.values violation.
ONEOF_REQUIRED_VIOLATION
Data for the oneof required violation.
REPEATED_ITEMS_VIOLATION
The data for the repeated.items violation.
REPEATED_MAX_ITEMS_VIOLATION
The data for the repeated.max_items violation.
REPEATED_MIN_ITEMS_VIOLATION
The data for the repeated.min_items violation.
REPEATED_UNIQUE_VIOLATION
The data for the repeated.unique violation.
REQUIRED_VIOLATION
Data for the required violation.
SFIXED32_CONST_VIOLATION
The data for the sfixed32.const violation.
SFIXED32_GTE_VIOLATION
The data for the sfixed32.gte violation.
SFIXED32_GT_VIOLATION
The data for the sfixed32.gt violation.
SFIXED32_IN_VIOLATION
The data for the sfixed32.in violation.
SFIXED32_LTE_VIOLATION
The data for the sfixed32.lte violation.
SFIXED32_LT_VIOLATION
The data for the sfixed32.lt violation.
SFIXED32_NOT_IN_VIOLATION
The data for the sfixed32.not_in violation.
SFIXED64_CONST_VIOLATION
The data for the sfixed64.const violation.
SFIXED64_GTE_VIOLATION
The data for the sfixed64.gte violation.
SFIXED64_GT_VIOLATION
The data for the sfixed64.gt violation.
SFIXED64_IN_VIOLATION
The data for the sfixed64.in violation.
SFIXED64_LTE_VIOLATION
The data for the sfixed64.lte violation.
SFIXED64_LT_VIOLATION
The data for the sfixed64.lt violation.
SFIXED64_NOT_IN_VIOLATION
The data for the sfixed64.not_in violation.
SINT32_CONST_VIOLATION
The data for the sint32.const violation.
SINT32_GTE_VIOLATION
The data for the sint32.gte violation.
SINT32_GT_VIOLATION
The data for the sint32.gt violation.
SINT32_IN_VIOLATION
The data for the sint32.in violation.
SINT32_LTE_VIOLATION
The data for the sint32.lte violation.
SINT32_LT_VIOLATION
The data for the sint32.lt violation.
SINT32_NOT_IN_VIOLATION
The data for the sint32.not_in violation.
SINT64_CONST_VIOLATION
The data for the sint64.const violation.
SINT64_GTE_VIOLATION
The data for the sint64.gte violation.
SINT64_GT_VIOLATION
The data for the sint64.gt violation.
SINT64_IN_VIOLATION
The data for the sint64.in violation.
SINT64_LTE_VIOLATION
The data for the sint64.lte violation.
SINT64_LT_VIOLATION
The data for the sint64.lt violation.
SINT64_NOT_IN_VIOLATION
The data for the sint64.not_in violation.
STRING_ADDRESS_VIOLATION
The data for the string.address violation.
STRING_CONST_VIOLATION
The data for the string.const violation.
STRING_CONTAINS_VIOLATION
The data for the string.contains violation.
STRING_EMAIL_VIOLATION
The data for the string.email violation.
STRING_HOSTNAME_VIOLATION
The data for the string.hostname violation.
STRING_HOST_AND_PORT_VIOLATION
The data for the string.host_and_port violation.
STRING_IN_VIOLATION
The data for the string.in violation.
STRING_IPV4_PREFIX_VIOLATION
The data for the string.ipv4_prefix violation.
STRING_IPV4_VIOLATION
The data for the string.ipv4 violation.
STRING_IPV4_WITH_PREFIXLEN_VIOLATION
The data for the string.ipv4_with_prefixlen violation.
STRING_IPV6_PREFIX_VIOLATION
The data for the string.ipv6_prefix violation.
STRING_IPV6_VIOLATION
The data for the string.ipv6 violation.
STRING_IPV6_WITH_PREFIXLEN_VIOLATION
The data for the string.ipv6_with_prefixlen violation.
STRING_IP_PREFIX_VIOLATION
The data for the string.ip_prefix violation.
STRING_IP_VIOLATION
The data for the string.ip violation.
STRING_IP_WITH_PREFIXLEN_VIOLATION
The data for the string.ip_with_prefixlen violation.
STRING_LEN_BYTES_VIOLATION
The data for the string.len_bytes violation.
STRING_LEN_VIOLATION
The data for the string.len violation.
STRING_MAX_BYTES_VIOLATION
The data for the string.max_bytes violation.
STRING_MAX_LEN_VIOLATION
The data for the string.max_len violation.
STRING_MIN_BYTES_VIOLATION
The data for the string.min_bytes violation.
STRING_MIN_LEN_VIOLATION
The data for the string.min_len violation.
STRING_NOT_CONTAINS_VIOLATION
The data for the string.not_contains violation.
STRING_NOT_IN_VIOLATION
The data for the string.not_in violation.
STRING_PATTERN_VIOLATION
The data for the string.pattern violation.
STRING_PREFIX_VIOLATION
The data for the string.prefix violation.
STRING_SUFFIX_VIOLATION
The data for the string.suffix violation.
STRING_TUUID_VIOLATION
The data for the string.tuuid violation.
STRING_ULID_VIOLATION
The data for the string.ulid violation.
STRING_URI_REF_VIOLATION
The data for the string.uri_ref violation.
STRING_URI_VIOLATION
The data for the string.uri violation.
STRING_UUID_VIOLATION
The data for the string.uuid violation.
STRING_WELL_KNOWN_REGEX_VIOLATION
The data for the string.well_known_regex violation.
TIMESTAMP_CONST_VIOLATION
The data for the timestamp.const violation.
TIMESTAMP_GTE_VIOLATION
The data for the timestamp.gte violation.
TIMESTAMP_GT_NOW_VIOLATION
The data for the timestamp.gt_now violation.
TIMESTAMP_GT_VIOLATION
The data for the timestamp.gt violation.
TIMESTAMP_LTE_VIOLATION
The data for the timestamp.lte violation.
TIMESTAMP_LT_NOW_VIOLATION
The data for the timestamp.lt_now violation.
TIMESTAMP_LT_VIOLATION
The data for the timestamp.lt violation.
TIMESTAMP_WITHIN_VIOLATION
The data for the timestamp.within violation.
UINT32_CONST_VIOLATION
The data for the uint32.const violation.
UINT32_GTE_VIOLATION
The data for the uint32.gte violation.
UINT32_GT_VIOLATION
The data for the uint32.gt violation.
UINT32_IN_VIOLATION
The data for the uint32.in violation.
UINT32_LTE_VIOLATION
The data for the uint32.lte violation.
UINT32_LT_VIOLATION
The data for the uint32.lt violation.
UINT32_NOT_IN_VIOLATION
The data for the uint32.not_in violation.
UINT64_CONST_VIOLATION
The data for the uint64.const violation.
UINT64_GTE_VIOLATION
The data for the uint64.gte violation.
UINT64_GT_VIOLATION
The data for the uint64.gt violation.
UINT64_IN_VIOLATION
The data for the uint64.in violation.
UINT64_LTE_VIOLATION
The data for the uint64.lte violation.
UINT64_LT_VIOLATION
The data for the uint64.lt violation.
UINT64_NOT_IN_VIOLATION
The data for the uint64.not_in violation.