#[non_exhaustive]pub enum SchemaConstraint {
MinSize(usize),
MaxSize(usize),
Minimum(Number),
Maximum(Number),
Nested(Vec<FieldConstraint>),
Each(Vec<FieldConstraint>),
}Expand description
A constraint on a schema, named the way OpenAPI names it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MinSize(usize)
A lower bound on the size of the value, published under the keyword its schema type
calls for: minLength for a string, minItems for an array, minProperties for an
object. The keywords are not interchangeable - one published against the wrong type
reads as no constraint at all - and only the schema knows which type this is.
MaxSize(usize)
An upper bound on the size of the value; see SchemaConstraint::MinSize
Minimum(Number)
minimum
Maximum(Number)
maximum
Nested(Vec<FieldConstraint>)
The field is an object, whose own fields carry these
Each(Vec<FieldConstraint>)
The field is an array, whose elements carry these
Trait Implementations§
Source§impl Clone for SchemaConstraint
impl Clone for SchemaConstraint
Source§impl Debug for SchemaConstraint
impl Debug for SchemaConstraint
Source§impl PartialEq for SchemaConstraint
impl PartialEq for SchemaConstraint
impl StructuralPartialEq for SchemaConstraint
Auto Trait Implementations§
impl Freeze for SchemaConstraint
impl RefUnwindSafe for SchemaConstraint
impl Send for SchemaConstraint
impl Sync for SchemaConstraint
impl Unpin for SchemaConstraint
impl UnsafeUnpin for SchemaConstraint
impl UnwindSafe for SchemaConstraint
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
Mutably borrows from an owned value. Read more