Struct rweb::openapi::Response [−][src]
pub struct Response {
pub description: Cow<'static, str>,
pub headers: IndexMap<Cow<'static, str>, ObjectOrReference<Header>, RandomState>,
pub content: IndexMap<Cow<'static, str>, MediaType, RandomState>,
pub links: IndexMap<Cow<'static, str>, ObjectOrReference<Link>, RandomState>,
}
Expand description
Describes a single response from an API Operation, including design-time, static links
to operations based on the response.
See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#responseObject.
Fields
description: Cow<'static, str>
A short description of the response. CommonMark syntax MAY be used for rich text representation.
headers: IndexMap<Cow<'static, str>, ObjectOrReference<Header>, RandomState>
Maps a header name to its definition.
RFC7230 states header names are case
insensitive. If a response header is defined with the name "Content-Type"
, it SHALL
be ignored.
content: IndexMap<Cow<'static, str>, MediaType, RandomState>
A map containing descriptions of potential response payloads. The key is a media type or media type range and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
links: IndexMap<Cow<'static, str>, ObjectOrReference<Link>, RandomState>
A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for Component Objects.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Response, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Response, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Response
impl UnwindSafe for Response
Blanket Implementations
Mutably borrows from an owned value. Read more
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
type Output = T
type Output = T
Should always be Self