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§
Source§impl 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§
Source§impl Clone for RepeatedRules
impl Clone for RepeatedRules
Source§fn clone(&self) -> RepeatedRules
fn clone(&self) -> RepeatedRules
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RepeatedRules
impl Debug for RepeatedRules
Source§impl Default for RepeatedRules
impl Default for RepeatedRules
Source§impl Message for RepeatedRules
impl Message for RepeatedRules
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 RepeatedRules
impl PartialEq for RepeatedRules
Source§impl ReflectMessage for RepeatedRules
impl ReflectMessage for RepeatedRules
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.