pub struct Discriminator {
pub property_name: String,
}
Expand description
OpenAPI Discriminator object which can be optionally used together with
OneOf
composite object.
Fields§
§property_name: String
Defines a discriminator property name which must be found within all composite objects.
Implementations§
source§impl Discriminator
impl Discriminator
sourcepub fn new<I: Into<String>>(property_name: I) -> Self
pub fn new<I: Into<String>>(property_name: I) -> Self
Construct a new Discriminator
object with property name.
§Examples
Create a new Discriminator
object for pet_type
property.
let discriminator = Discriminator::new("pet_type");
Trait Implementations§
source§impl Clone for Discriminator
impl Clone for Discriminator
source§fn clone(&self) -> Discriminator
fn clone(&self) -> Discriminator
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for Discriminator
impl Default for Discriminator
source§fn default() -> Discriminator
fn default() -> Discriminator
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Discriminator
impl<'de> Deserialize<'de> for Discriminator
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Discriminator
impl PartialEq for Discriminator
source§impl Serialize for Discriminator
impl Serialize for Discriminator
impl Eq for Discriminator
impl StructuralPartialEq for Discriminator
Auto Trait Implementations§
impl Freeze for Discriminator
impl RefUnwindSafe for Discriminator
impl Send for Discriminator
impl Sync for Discriminator
impl Unpin for Discriminator
impl UnwindSafe for Discriminator
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
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)
🔬This is a nightly-only experimental API. (
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
Compare self to
key
and return true
if they are equal.