#[non_exhaustive]pub enum Schema {
Any,
Null,
Boolean,
Number,
Integer {
min: i64,
max: i64,
},
Unsigned {
min: u64,
max: u64,
},
String {
min: usize,
max: usize,
choices: &'static [&'static str],
},
Array {
items: &'static Schema,
min: usize,
max: usize,
},
Object {
properties: &'static [Property],
additional: bool,
},
OneOf(&'static [Schema]),
}Expand description
Supported JSON Schema subset, represented without parsing schema text at runtime.
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.
Any
Any bounded JSON value.
Null
Null only.
Boolean
Boolean only.
Number
Any syntactically valid JSON number.
Integer
Signed integer with inclusive bounds.
Unsigned
Unsigned integer with inclusive bounds, retaining all 64 bits.
String
Unicode string, with lengths in Unicode scalar values and optional allowed values.
Fields
Array
Array whose items all follow one schema.
Fields
Object
Object with named properties and an explicit policy for unknown names.
Fields
OneOf(&'static [Schema])
Exactly one member schema must match.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Forget for Schema
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
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