pub struct FieldMaskRules {
pub const: Option<FieldMask>,
pub in: Vec<String>,
pub not_in: Vec<String>,
pub example: Vec<FieldMask>,
}Expand description
FieldMaskRules describe rules applied exclusively to the google.protobuf.FieldMask well-known type.
Fields§
§const: Option<FieldMask>const dictates that the field must match the specified value of the google.protobuf.FieldMask type exactly.
If the field’s value deviates from the specified value, an error message
will be generated.
message MyFieldMask {
// value must equal \["a"\]
google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {
paths: \["a"\]
}];
}in: Vec<String>in requires the field value to only contain paths matching specified
values or their subpaths.
If any of the field value’s paths doesn’t match the rule,
an error message is generated.
See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
message MyFieldMask {
// The `value` FieldMask must only contain paths listed in `in`.
google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
in: \["a", "b", "c.a"\]
}];
}not_in: Vec<String>not_in requires the field value to not contain paths matching specified
values or their subpaths.
If any of the field value’s paths matches the rule,
an error message is generated.
See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
message MyFieldMask {
// The `value` FieldMask shall not contain paths listed in `not_in`.
google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
not_in: \["forbidden", "immutable", "c.a"\]
}];
}example: Vec<FieldMask>example specifies values that the field may have. These values SHOULD
conform to other rules. example values will not impact validation
but may be used as helpful guidance on how to populate the given field.
message MyFieldMask {
google.protobuf.FieldMask value = 1 [
(buf.validate.field).field_mask.example = { paths: \["a", "b"\] },
(buf.validate.field).field_mask.example = { paths: \["c.a", "d"\] },
];
}Trait Implementations§
Source§impl Clone for FieldMaskRules
impl Clone for FieldMaskRules
Source§fn clone(&self) -> FieldMaskRules
fn clone(&self) -> FieldMaskRules
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FieldMaskRules
impl Debug for FieldMaskRules
Source§impl Default for FieldMaskRules
impl Default for FieldMaskRules
Source§impl Message for FieldMaskRules
impl Message for FieldMaskRules
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for FieldMaskRules
impl PartialEq for FieldMaskRules
Source§impl ReflectMessage for FieldMaskRules
impl ReflectMessage for FieldMaskRules
Source§fn descriptor(&self) -> MessageDescriptor
fn descriptor(&self) -> MessageDescriptor
MessageDescriptor describing the type of this message.Source§fn transcode_to_dynamic(&self) -> DynamicMessagewhere
Self: Sized,
fn transcode_to_dynamic(&self) -> DynamicMessagewhere
Self: Sized,
DynamicMessage by going
through the byte representation.