pub struct MapRules {
pub min_pairs: Option<u64>,
pub max_pairs: Option<u64>,
pub no_sparse: Option<bool>,
pub keys: Option<Box<FieldRules>>,
pub values: Option<Box<FieldRules>>,
pub ignore_empty: Option<bool>,
}
Expand description
MapRules describe the constraints applied to map
values
Fields§
§min_pairs: Option<u64>
MinPairs specifies that this field must have the specified number of KVs at a minimum
max_pairs: Option<u64>
MaxPairs specifies that this field must have the specified number of KVs at a maximum
no_sparse: Option<bool>
NoSparse specifies values in this field cannot be unset. This only applies to map’s with message value types.
keys: Option<Box<FieldRules>>
Keys specifies the constraints to be applied to each key in the field.
values: Option<Box<FieldRules>>
Values specifies the constraints to be applied to the value of each key in the field. Message values will still have their validations evaluated unless skip is specified here.
ignore_empty: Option<bool>
IgnoreEmpty specifies that the validation rules of this field should be evaluated only if the field is not empty
Implementations§
Source§impl MapRules
impl MapRules
Sourcepub fn min_pairs(&self) -> u64
pub fn min_pairs(&self) -> u64
Returns the value of min_pairs
, or the default value if min_pairs
is unset.
Sourcepub fn max_pairs(&self) -> u64
pub fn max_pairs(&self) -> u64
Returns the value of max_pairs
, or the default value if max_pairs
is unset.
Sourcepub fn no_sparse(&self) -> bool
pub fn no_sparse(&self) -> bool
Returns the value of no_sparse
, or the default value if no_sparse
is unset.
Sourcepub fn ignore_empty(&self) -> bool
pub fn ignore_empty(&self) -> bool
Returns the value of ignore_empty
, or the default value if ignore_empty
is unset.
Trait Implementations§
Source§impl Message for MapRules
impl Message for MapRules
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 Name for MapRules
impl Name for MapRules
Source§const NAME: &'static str = "MapRules"
const NAME: &'static str = "MapRules"
Message
.
This name is the same as it appears in the source .proto file, e.g. FooBar
.Source§const PACKAGE: &'static str = "validate"
const PACKAGE: &'static str = "validate"
.
, e.g. google.protobuf
.Source§fn full_name() -> String
fn full_name() -> String
Message
.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation
.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.impl StructuralPartialEq for MapRules
Auto Trait Implementations§
impl Freeze for MapRules
impl RefUnwindSafe for MapRules
impl Send for MapRules
impl Sync for MapRules
impl Unpin for MapRules
impl UnwindSafe for MapRules
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request