pub enum SchemaNode {
Any {
description: String,
},
String {
description: String,
},
Number {
description: String,
min: Option<f64>,
max: Option<f64>,
},
Boolean {
description: String,
},
Enum {
description: String,
values: Vec<String>,
},
Array {
description: String,
items: Box<SchemaNode>,
min_items: Option<usize>,
},
Object {
description: String,
fields: Vec<FieldSpec>,
allow_extra: bool,
},
}Variants§
Implementations§
Source§impl SchemaNode
impl SchemaNode
pub fn any(description: impl Into<String>) -> Self
pub fn string(description: impl Into<String>) -> Self
pub fn boolean(description: impl Into<String>) -> Self
pub fn number( description: impl Into<String>, min: Option<f64>, max: Option<f64>, ) -> Self
pub fn enumeration(description: impl Into<String>, values: Vec<&str>) -> Self
pub fn array( description: impl Into<String>, items: SchemaNode, min_items: Option<usize>, ) -> Self
pub fn object( description: impl Into<String>, fields: Vec<FieldSpec>, allow_extra: bool, ) -> Self
pub fn to_value(&self) -> Value
pub fn validate(&self, value: &Value, path: &str, problems: &mut Vec<Problem>)
Trait Implementations§
Source§impl Clone for SchemaNode
impl Clone for SchemaNode
Source§fn clone(&self) -> SchemaNode
fn clone(&self) -> SchemaNode
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 SchemaNode
impl Debug for SchemaNode
Source§impl PartialEq for SchemaNode
impl PartialEq for SchemaNode
Source§fn eq(&self, other: &SchemaNode) -> bool
fn eq(&self, other: &SchemaNode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SchemaNode
Auto Trait Implementations§
impl Freeze for SchemaNode
impl RefUnwindSafe for SchemaNode
impl Send for SchemaNode
impl Sync for SchemaNode
impl Unpin for SchemaNode
impl UnsafeUnpin for SchemaNode
impl UnwindSafe for SchemaNode
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