#[non_exhaustive]
pub enum Schema { Array(Array), Object(Object), OneOf(OneOf), AllOf(AllOf), AnyOf(AnyOf), }
Expand description

Is super type for OpenAPI Schema Object. Schema is reusable resource what can be referenced from path operations and other components using Ref.

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

Array(Array)

Defines array schema from another schema. Typically used with Schema::Object. Slice and Vec types are translated to Schema::Array types.

§

Object(Object)

Defines object schema. Object is either object holding properties which are other Schemas or can be a field within the Object.

§

OneOf(OneOf)

Creates a OneOf type composite Object schema. This schema is used to map multiple schemas together where API endpoint could return any of them. Schema::OneOf is created form complex enum where enum holds other than unit types.

§

AllOf(AllOf)

Creates a AllOf type composite Object schema.

§

AnyOf(AnyOf)

Creates a AnyOf type composite Object schema.

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 Default for Schema

source§

fn default() -> Self

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

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

source§

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

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

impl From<AllOf> for Schema

source§

fn from(one_of: AllOf) -> Self

Converts to this type from the input type.
source§

impl From<AllOfBuilder> for Schema

source§

fn from(builder: AllOfBuilder) -> Self

Converts to this type from the input type.
source§

impl From<AnyOf> for Schema

source§

fn from(any_of: AnyOf) -> Self

Converts to this type from the input type.
source§

impl From<AnyOfBuilder> for Schema

source§

fn from(builder: AnyOfBuilder) -> Self

Converts to this type from the input type.
source§

impl From<Array> for Schema

source§

fn from(array: Array) -> Self

Converts to this type from the input type.
source§

impl From<ArrayBuilder> for Schema

source§

fn from(builder: ArrayBuilder) -> Self

Converts to this type from the input type.
source§

impl From<Object> for Schema

source§

fn from(s: Object) -> Self

Converts to this type from the input type.
source§

impl From<ObjectBuilder> for Schema

source§

fn from(builder: ObjectBuilder) -> Self

Converts to this type from the input type.
source§

impl From<OneOf> for Schema

source§

fn from(one_of: OneOf) -> Self

Converts to this type from the input type.
source§

impl From<OneOfBuilder> for Schema

source§

fn from(builder: OneOfBuilder) -> Self

Converts to this type from the input type.
source§

impl From<Schema> for AdditionalProperties<Schema>

source§

fn from(value: Schema) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Schema

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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::Ok, __S::Error>
where __S: Serializer,

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

impl StructuralPartialEq for Schema

Auto Trait Implementations§

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> 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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>,