pub enum ParameterShape {
Schema {
schema: Schema,
style: Option<Style>,
explode: Option<bool>,
allow_reserved: Option<bool>,
},
Content {
media_type: String,
value: Box<MediaType>,
},
}Expand description
How a parameter’s value is described.
A parameter carries schema or content, never both and never neither.
style, explode and allowReserved only mean anything alongside a
schema, so they live in that variant rather than beside it — setting a style
on a content-described parameter is not a mistake to report, it is a
sentence with nowhere to be written.
Variants§
Schema
The simple case: a schema, plus how its value is serialized.
Fields
Content
The complex case: one media type describing the value.
The specification allows exactly one entry, so this holds one pair
rather than a map that has to be counted. Boxed because a MediaType
dwarfs the schema-side fields, and every parameter would otherwise pay
for the larger of the two.
Trait Implementations§
Source§impl Clone for ParameterShape
impl Clone for ParameterShape
Source§impl Debug for ParameterShape
impl Debug for ParameterShape
Source§impl PartialEq for ParameterShape
impl PartialEq for ParameterShape
impl StructuralPartialEq for ParameterShape
Auto Trait Implementations§
impl Freeze for ParameterShape
impl RefUnwindSafe for ParameterShape
impl Send for ParameterShape
impl Sync for ParameterShape
impl Unpin for ParameterShape
impl UnsafeUnpin for ParameterShape
impl UnwindSafe for ParameterShape
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