pub enum Type {
Object,
String,
Integer,
Number,
Boolean,
Array,
Null,
}
Expand description
Represents data type fragment of Schema
.
Type
is used to create a SchemaType
that defines the type of the Schema
.
SchemaType
can be created from a single Type
or multiple Type
s according to the
OpenAPI 3.1 spec. Since the OpenAPI 3.1 is fully compatible with JSON schema the definition of
the type property comes from JSON Schema type.
§Examples
Create nullable string SchemaType
let _: SchemaType = [Type::String, Type::Null].into_iter().collect();
Create string SchemaType
let _ = SchemaType::new(Type::String);
Variants§
Object
Used with Object
and ObjectBuilder
to describe schema that has properties
describing fields.
String
Indicates string type of content. Used with Object
and ObjectBuilder
on a string
field.
Integer
Indicates integer type of content. Used with Object
and ObjectBuilder
on a number
field.
Number
Indicates floating point number type of content. Used with
Object
and ObjectBuilder
on a number
field.
Boolean
Indicates boolean type of content. Used with Object
and ObjectBuilder
on
a bool
field.
Array
Used with Array
and ArrayBuilder
. Indicates array type of content.
Null
Null type. Used together with other type to indicate nullable values.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<Type> for SchemaType
impl From<Type> for SchemaType
Source§impl FromIterator<Type> for SchemaType
impl FromIterator<Type> for SchemaType
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.