pub struct Constraints {Show 16 fields
pub pattern: Option<String>,
pub min_length: Option<usize>,
pub max_length: Option<usize>,
pub minimum: Option<Bound>,
pub maximum: Option<Bound>,
pub exclusive_minimum: bool,
pub exclusive_maximum: bool,
pub folded_minimum: bool,
pub folded_maximum: bool,
pub multiple_of: Option<Bound>,
pub min_items: Option<usize>,
pub max_items: Option<usize>,
pub unique_items: bool,
pub min_properties: Option<usize>,
pub max_properties: Option<usize>,
pub checked_as: Option<RustType>,
}Expand description
The validation keywords a schema declares.
A field with no keyword carries None, so the common schema costs nothing.
Fields§
§pattern: Option<String>pattern: the value must match this regular expression.
min_length: Option<usize>minLength, counted in characters, as JSON Schema counts them.
max_length: Option<usize>maxLength, counted in characters.
minimum: Option<Bound>minimum.
maximum: Option<Bound>maximum.
exclusive_minimum: boolexclusiveMinimum: makes minimum a strict bound.
exclusive_maximum: boolexclusiveMaximum: makes maximum a strict bound.
folded_minimum: boolWhether minimum moved to absorb an exclusiveMinimum.
The bound then holds a number the document does not write, and a message about it must name the number the author wrote instead.
folded_maximum: boolWhether maximum moved to absorb an exclusiveMaximum.
multiple_of: Option<Bound>multipleOf.
min_items: Option<usize>minItems.
max_items: Option<usize>maxItems.
unique_items: booluniqueItems.
min_properties: Option<usize>minProperties.
max_properties: Option<usize>maxProperties.
checked_as: Option<RustType>The type the checks run against, when the field names an alias.
A $ref to a constrained scalar gives the field a named type, and the
name alone does not say which check applies. Lowering resolves the ref
and records the type behind the name here.
Implementations§
Trait Implementations§
Source§impl Clone for Constraints
impl Clone for Constraints
Source§fn clone(&self) -> Constraints
fn clone(&self) -> Constraints
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more