#[non_exhaustive]pub enum Style {
Matrix,
Label,
Simple,
Form,
SpaceDelimited,
PipeDelimited,
DeepObject,
Cookie,
}Expand description
How a parameter value is serialized.
Not every combination of style and location is legal; OpenAPI 3.2 states
that the table of valid combinations is closed. crate::validate checks
the pairing.
#[non_exhaustive] because OpenAPI 3.2 adds to this and the addition is
#[cfg]-gated. Cargo unifies features across a dependency graph, so any
crate enabling openapi32 enables it for every crate in the build – and
without this attribute that would turn a downstream exhaustive match into
a compile error, which is not what “purely additive” is supposed to mean.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Matrix
Path-style parameters defined by RFC 6570. Path only.
Label
Label-style expansion defined by RFC 6570. Path only.
Simple
Comma-separated values. The default for path and header.
Form
Form-style expansion. The default for query and cookie.
SpaceDelimited
Space-separated array or object values. Query only.
PipeDelimited
Pipe-separated array or object values. Query only.
DeepObject
Nested objects rendered as param[prop]=value.
Query only, and defined only for objects whose properties are scalars.
Anything deeper needs ParameterIn::Querystring.
Cookie
Cookie-style serialization.
Introduced in OpenAPI 3.2. Cookie only.
Implementations§
Source§impl Style
impl Style
Sourcepub fn default_for(location: ParameterIn) -> Self
pub fn default_for(location: ParameterIn) -> Self
The style applied when none is stated, given a parameter location.
Sourcepub fn is_valid_for(self, location: ParameterIn) -> bool
pub fn is_valid_for(self, location: ParameterIn) -> bool
Whether this style may be used at the given location.
Sourcepub fn default_explode(self) -> bool
pub fn default_explode(self) -> bool
Whether explode defaults to true for this style.
The two styles that pair a name with each value default to exploding;
every other style defaults to false.
Trait Implementations§
impl Copy for Style
Source§impl<'de> Deserialize<'de> for Style
impl<'de> Deserialize<'de> for Style
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>,
impl Eq for Style
Source§impl From<EncodingStyle> for Style
impl From<EncodingStyle> for Style
Source§fn from(style: EncodingStyle) -> Self
fn from(style: EncodingStyle) -> Self
Source§impl From<HeaderStyle> for Style
impl From<HeaderStyle> for Style
Source§fn from(_: HeaderStyle) -> Self
fn from(_: HeaderStyle) -> Self
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.