Struct data_plane_api::validate::RepeatedRules
source · [−]pub struct RepeatedRules {
pub min_items: Option<u64>,
pub max_items: Option<u64>,
pub unique: Option<bool>,
pub items: Option<Box<FieldRules>>,
pub ignore_empty: Option<bool>,
}
Expand description
RepeatedRules describe the constraints applied to repeated
values
Fields
min_items: Option<u64>
MinItems specifies that this field must have the specified number of items at a minimum
max_items: Option<u64>
MaxItems specifies that this field must have the specified number of items at a maximum
unique: Option<bool>
Unique specifies that all elements in this field must be unique. This contraint is only applicable to scalar and enum types (messages are not supported).
items: Option<Box<FieldRules>>
Items specifies the contraints to be applied to each item in the field. Repeated message fields will still execute validation against each item 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 RepeatedRules
impl RepeatedRules
sourcepub fn min_items(&self) -> u64
pub fn min_items(&self) -> u64
Returns the value of min_items
, or the default value if min_items
is unset.
sourcepub fn max_items(&self) -> u64
pub fn max_items(&self) -> u64
Returns the value of max_items
, or the default value if max_items
is unset.
sourcepub fn unique(&self) -> bool
pub fn unique(&self) -> bool
Returns the value of unique
, or the default value if unique
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 Clone for RepeatedRules
impl Clone for RepeatedRules
sourcefn clone(&self) -> RepeatedRules
fn clone(&self) -> RepeatedRules
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for RepeatedRules
impl Debug for RepeatedRules
sourceimpl Default for RepeatedRules
impl Default for RepeatedRules
sourceimpl Message for RepeatedRules
impl Message for RepeatedRules
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 moresourceimpl PartialEq<RepeatedRules> for RepeatedRules
impl PartialEq<RepeatedRules> for RepeatedRules
sourcefn eq(&self, other: &RepeatedRules) -> bool
fn eq(&self, other: &RepeatedRules) -> bool
impl StructuralPartialEq for RepeatedRules
Auto Trait Implementations
impl RefUnwindSafe for RepeatedRules
impl Send for RepeatedRules
impl Sync for RepeatedRules
impl Unpin for RepeatedRules
impl UnwindSafe for RepeatedRules
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