Struct Schema

Source
pub struct Schema {
Show 52 fields pub ref_value: Option<String>, pub defs: Option<IndexMap<String, Schema>>, pub id: Option<String>, pub comment: Option<String>, pub title: Option<String>, pub description: Option<String>, pub schema_type: Option<OneOrMultiTypes>, pub default: Option<Value>, pub deprecated: Option<bool>, pub maximum: Option<Number>, pub minimum: Option<Number>, pub exclusive_maximum: Option<bool>, pub exclusive_minimum: Option<bool>, pub multiple_of: Option<f64>, pub max_length: Option<u32>, pub min_length: Option<u32>, pub pattern: Option<String>, pub format: Option<String>, pub content_encoding: Option<String>, pub content_media_type: Option<String>, pub items: Option<OneOrMultiSchemas>, pub max_items: Option<u32>, pub min_items: Option<u32>, pub unique_items: Option<bool>, pub additional_items: Option<BoolOrSchema>, pub contains: Option<Box<Schema>>, pub max_contains: Option<u32>, pub min_contains: Option<u32>, pub unevaluated_items: Option<BoolOrSchema>, pub properties: Option<IndexMap<String, Schema>>, pub max_properties: Option<u32>, pub min_properties: Option<u32>, pub required: Option<Vec<String>>, pub pattern_properties: Option<IndexMap<String, Schema>>, pub additional_properties: Option<BoolOrSchema>, pub dependent_required: Option<IndexMap<String, Vec<String>>>, pub dependent_schemas: Option<IndexMap<String, Schema>>, pub property_names: Option<Box<Schema>>, pub unevaluated_properties: Option<BoolOrSchema>, pub enum_value: Option<Vec<Value>>, pub const_value: Option<Value>, pub examples: Option<Vec<Value>>, pub read_only: Option<bool>, pub write_only: Option<bool>, pub all_of: Option<Vec<Schema>>, pub one_of: Option<Vec<Schema>>, pub any_of: Option<Vec<Schema>>, pub not: Option<Box<Schema>>, pub if_value: Option<Box<Schema>>, pub then_value: Option<Box<Schema>>, pub else_value: Option<Box<Schema>>, pub unknown: Option<Map<String, Value>>,
}

Fields§

§ref_value: Option<String>§defs: Option<IndexMap<String, Schema>>§id: Option<String>§comment: Option<String>§title: Option<String>§description: Option<String>§schema_type: Option<OneOrMultiTypes>§default: Option<Value>§deprecated: Option<bool>§maximum: Option<Number>§minimum: Option<Number>§exclusive_maximum: Option<bool>§exclusive_minimum: Option<bool>§multiple_of: Option<f64>§max_length: Option<u32>§min_length: Option<u32>§pattern: Option<String>§format: Option<String>§content_encoding: Option<String>§content_media_type: Option<String>§items: Option<OneOrMultiSchemas>§max_items: Option<u32>§min_items: Option<u32>§unique_items: Option<bool>§additional_items: Option<BoolOrSchema>§contains: Option<Box<Schema>>§max_contains: Option<u32>§min_contains: Option<u32>§unevaluated_items: Option<BoolOrSchema>§properties: Option<IndexMap<String, Schema>>§max_properties: Option<u32>§min_properties: Option<u32>§required: Option<Vec<String>>§pattern_properties: Option<IndexMap<String, Schema>>§additional_properties: Option<BoolOrSchema>§dependent_required: Option<IndexMap<String, Vec<String>>>§dependent_schemas: Option<IndexMap<String, Schema>>§property_names: Option<Box<Schema>>§unevaluated_properties: Option<BoolOrSchema>§enum_value: Option<Vec<Value>>§const_value: Option<Value>§examples: Option<Vec<Value>>§read_only: Option<bool>§write_only: Option<bool>§all_of: Option<Vec<Schema>>§one_of: Option<Vec<Schema>>§any_of: Option<Vec<Schema>>§not: Option<Box<Schema>>§if_value: Option<Box<Schema>>§then_value: Option<Box<Schema>>§else_value: Option<Box<Schema>>§unknown: Option<Map<String, Value>>

Implementations§

Source§

impl Schema

Source

pub fn pointer(&self, keys: &Keys) -> Vec<&Schema>

Source

pub fn maybe_type(&self, schema_type: &SchemaType) -> bool

Source

pub fn one_type(&self) -> Option<SchemaType>

Source

pub fn types(&self) -> HashSet<SchemaType>

Source

pub fn debug_string(&self) -> String

Trait Implementations§

Source§

impl Clone for Schema

Source§

fn clone(&self) -> Schema

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Schema

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Schema

Source§

fn default() -> Schema

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Schema

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Schema, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Schema

Source§

fn eq(&self, other: &Schema) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Schema

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<&Node> for Schema

Source§

type Error = Vec<SchemaError>

The type returned in the event of a conversion error.
Source§

fn try_from(node: &Node) -> Result<Schema, Vec<SchemaError>>

Performs the conversion.
Source§

impl StructuralPartialEq for Schema

Auto Trait Implementations§

§

impl Freeze for Schema

§

impl RefUnwindSafe for Schema

§

impl Send for Schema

§

impl Sync for Schema

§

impl Unpin for Schema

§

impl UnwindSafe for Schema

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T