Struct openapiv3::Discriminator
source · [−]pub struct Discriminator {
pub property_name: String,
pub mapping: IndexMap<String, String>,
pub extensions: IndexMap<String, Value>,
}
Expand description
When request bodies or response payloads may be one of a number of different schemas, a discriminator object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
When using the discriminator, inline schemas will not be considered.
Fields
property_name: String
REQUIRED. The name of the property in the payload that will hold the discriminator value.
mapping: IndexMap<String, String>
An object to hold mappings between payload values and schema names or references.
extensions: IndexMap<String, Value>
Inline extensions to this object.
Trait Implementations
sourceimpl Clone for Discriminator
impl Clone for Discriminator
sourcefn clone(&self) -> Discriminator
fn clone(&self) -> Discriminator
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Discriminator
impl Debug for Discriminator
sourceimpl Default for Discriminator
impl Default for Discriminator
sourcefn default() -> Discriminator
fn default() -> Discriminator
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for Discriminator
impl<'de> Deserialize<'de> for Discriminator
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Discriminator> for Discriminator
impl PartialEq<Discriminator> for Discriminator
sourcefn eq(&self, other: &Discriminator) -> bool
fn eq(&self, other: &Discriminator) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Discriminator) -> bool
fn ne(&self, other: &Discriminator) -> bool
This method tests for !=
.
sourceimpl Serialize for Discriminator
impl Serialize for Discriminator
impl StructuralPartialEq for Discriminator
Auto Trait Implementations
impl RefUnwindSafe for Discriminator
impl Send for Discriminator
impl Sync for Discriminator
impl Unpin for Discriminator
impl UnwindSafe for Discriminator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more