Struct data_plane_api::validate::MapRules
source · [−]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
sourceimpl 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
sourceimpl Message for MapRules
impl Message for MapRules
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
sourcefn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
sourcefn encode_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
sourcefn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
sourcefn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
sourcefn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
sourcefn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
sourcefn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moresourcefn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moreimpl StructuralPartialEq for MapRules
Auto Trait Implementations
impl RefUnwindSafe for MapRules
impl Send for MapRules
impl Sync for MapRules
impl Unpin for MapRules
impl UnwindSafe for MapRules
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request