#[non_exhaustive]pub struct Encoding {
pub content_type: Option<String>,
pub headers: BTreeMap<String, Header>,
pub style: Option<ParameterStyle>,
pub explode: Option<bool>,
pub allow_reserved: Option<bool>,
}
Expand description
A single encoding definition applied to a single schema Object property
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.content_type: Option<String>
The Content-Type for encoding a specific property. Default value depends on the property
type: for string with format being binary – application/octet-stream
; for other primitive
types – text/plain
; for object - application/json
; for array – the default is defined
based on the inner type. The value can be a specific media type (e.g. application/json
),
a wildcard media type (e.g. image/*
), or a comma-separated list of the two types.
headers: BTreeMap<String, Header>
A map allowing additional information to be provided as headers, for example Content-Disposition. Content-Type is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a multipart.
style: Option<ParameterStyle>
Describes how a specific property value will be serialized depending on its type. See
Parameter Object for details on the style property. The behavior follows the same values as
query parameters, including default values. This property SHALL be ignored if the request
body media type is not application/x-www-form-urlencoded
.
explode: Option<bool>
When this is true, property values of type array or object generate separate parameters for
each value of the array, or key-value-pair of the map. For other types of properties this
property has no effect. When style is form, the default value is true. For all other
styles, the default value is false. This property SHALL be ignored if the request body
media type is not application/x-www-form-urlencoded
.
allow_reserved: Option<bool>
Determines whether the parameter value SHOULD allow reserved characters, as defined by
RFC3986 :/?#[]@!$&'()*+,;=
to be included without percent-encoding. The default value is
false. This property SHALL be ignored if the request body media type is not
application/x-www-form-urlencoded
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Encoding
impl<'de> Deserialize<'de> for Encoding
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<Encoding> for EncodingBuilder
impl From<Encoding> for EncodingBuilder
source§impl From<EncodingBuilder> for Encoding
impl From<EncodingBuilder> for Encoding
source§fn from(value: EncodingBuilder) -> Self
fn from(value: EncodingBuilder) -> Self
impl StructuralPartialEq for Encoding
Auto Trait Implementations§
impl Freeze for Encoding
impl RefUnwindSafe for Encoding
impl Send for Encoding
impl Sync for Encoding
impl Unpin for Encoding
impl UnwindSafe for Encoding
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
)