pub trait FieldConstraintsExt {
// Required methods
fn field_constraints(&self) -> ConstraintDecodeResult<FieldRules>;
fn real_oneof(&self) -> Option<OneofDescriptor>;
fn is_optional(&self) -> bool;
}Expand description
Extension trait for extracting buf.validate.field rules from a field descriptor.
Required Methods§
Sourcefn field_constraints(&self) -> ConstraintDecodeResult<FieldRules>
fn field_constraints(&self) -> ConstraintDecodeResult<FieldRules>
Returns the FieldRules for this field, if any.
§Errors
Returns an error if the extension value cannot be transcoded to FieldRules.
Sourcefn real_oneof(&self) -> Option<OneofDescriptor>
fn real_oneof(&self) -> Option<OneofDescriptor>
Returns the real (non-synthetic) oneof containing this field, if any.
Sourcefn is_optional(&self) -> bool
fn is_optional(&self) -> bool
Returns true if this field is proto3 optional (synthetic oneof).