pub enum SchemaType {
Object {
properties: HashMap<String, SchemaType>,
required: Vec<String>,
},
Array {
items: Option<Box<SchemaType>>,
min_items: Option<usize>,
max_items: Option<usize>,
},
String {
enum_values: Option<Vec<String>>,
min_length: Option<usize>,
max_length: Option<usize>,
},
Number {
minimum: Option<f64>,
maximum: Option<f64>,
},
Integer {
minimum: Option<i64>,
maximum: Option<i64>,
},
Boolean,
Null,
AnyOf(Vec<SchemaType>),
}Expand description
A parsed JSON schema (subset).
Variants§
Object
An object with named properties and a list of required keys.
Fields
§
properties: HashMap<String, SchemaType>Property name → sub-schema.
Array
An array, optionally with a uniform item schema and length bounds.
Fields
§
items: Option<Box<SchemaType>>Schema for each element.
String
A string, optionally constrained by enum values or length.
Fields
Number
A floating-point number with optional bounds.
Integer
An integer with optional bounds.
Boolean
A JSON boolean (true or false).
Null
The JSON null literal.
AnyOf(Vec<SchemaType>)
A union of schemas (anyOf).
Implementations§
Source§impl SchemaType
impl SchemaType
Trait Implementations§
Source§impl Clone for SchemaType
impl Clone for SchemaType
Source§fn clone(&self) -> SchemaType
fn clone(&self) -> SchemaType
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 moreAuto Trait Implementations§
impl Freeze for SchemaType
impl RefUnwindSafe for SchemaType
impl Send for SchemaType
impl Sync for SchemaType
impl Unpin for SchemaType
impl UnsafeUnpin for SchemaType
impl UnwindSafe for SchemaType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more