pub struct PropertyConstraints {
pub minimum: Option<f64>,
pub maximum: Option<f64>,
pub exclusive_minimum: Option<f64>,
pub exclusive_maximum: Option<f64>,
pub multiple_of: Option<f64>,
pub min_length: Option<u64>,
pub max_length: Option<u64>,
pub pattern: Option<String>,
pub min_items: Option<u64>,
pub max_items: Option<u64>,
pub unique_items: Option<bool>,
}Expand description
Q2.4 — per-property OpenAPI constraint annotations
(minimum/maximum/minLength/maxLength/pattern/etc.).
Populated during analysis from SchemaDetails; consumed by the
generator to emit doc comments and/or #[validate(...)] attrs.
Fields§
§minimum: Option<f64>§maximum: Option<f64>§exclusive_minimum: Option<f64>§exclusive_maximum: Option<f64>§multiple_of: Option<f64>§min_length: Option<u64>§max_length: Option<u64>§pattern: Option<String>§min_items: Option<u64>§max_items: Option<u64>§unique_items: Option<bool>Implementations§
Source§impl PropertyConstraints
impl PropertyConstraints
pub fn is_empty(&self) -> bool
Sourcepub fn from_schema_details(details: &SchemaDetails) -> Self
pub fn from_schema_details(details: &SchemaDetails) -> Self
Capture the constraint-related fields off a SchemaDetails.
Exclusive bounds in OpenAPI 3.1 are numeric (exclusiveMinimum: 5); we map the OAS-3.0 boolean flag form by leaving the
exclusive field unset and letting minimum/maximum carry it.
Trait Implementations§
Source§impl Clone for PropertyConstraints
impl Clone for PropertyConstraints
Source§fn clone(&self) -> PropertyConstraints
fn clone(&self) -> PropertyConstraints
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PropertyConstraints
impl Debug for PropertyConstraints
Source§impl Default for PropertyConstraints
impl Default for PropertyConstraints
Source§fn default() -> PropertyConstraints
fn default() -> PropertyConstraints
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PropertyConstraints
impl RefUnwindSafe for PropertyConstraints
impl Send for PropertyConstraints
impl Sync for PropertyConstraints
impl Unpin for PropertyConstraints
impl UnsafeUnpin for PropertyConstraints
impl UnwindSafe for PropertyConstraints
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