1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | static CONTENT_TYPE_HTTPSTRINGPAYLOAD2: ::once_cell::sync::Lazy<::mime::Mime> =
|
3 - | ::once_cell::sync::Lazy::new(|| {
|
4 - | "text/plain"
|
5 - | .parse::<::mime::Mime>()
|
6 - | .expect("BUG: MIME parsing failed, content_type is not valid")
|
7 - | });
|
8 - | ::pin_project_lite::pin_project! {
|
9 - | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
10 - | /// [`HttpStringPayload2Input`](crate::input::HttpStringPayload2Input) using modelled bindings.
|
11 - | pub struct HttpStringPayload2InputFuture {
|
12 - | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpStringPayload2Input, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
13 - | }
|
14 - | }
|
15 - |
|
16 - | impl std::future::Future for HttpStringPayload2InputFuture {
|
17 - | type Output = Result<
|
18 - | crate::input::HttpStringPayload2Input,
|
19 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
20 - | >;
|
21 - |
|
22 - | fn poll(
|
23 - | self: std::pin::Pin<&mut Self>,
|
24 - | cx: &mut std::task::Context<'_>,
|
25 - | ) -> std::task::Poll<Self::Output> {
|
26 - | let this = self.project();
|
27 - | this.inner.as_mut().poll(cx)
|
28 - | }
|
29 - | }
|
30 - |
|
31 - | impl<B>
|
32 - | ::aws_smithy_http_server::request::FromRequest<
|
33 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
34 - | B,
|
35 - | > for crate::input::HttpStringPayload2Input
|
36 - | where
|
37 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
38 - | B: 'static,
|
39 - |
|
40 - | B::Data: Send,
|
41 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
42 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
43 - | {
|
44 - | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
45 - | type Future = HttpStringPayload2InputFuture;
|
46 - |
|
47 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
48 - | let fut = async move {
|
49 - | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
50 - | request.headers(),
|
51 - | &CONTENT_TYPE_HTTPSTRINGPAYLOAD2,
|
52 - | ) {
|
53 - | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
54 - | }
|
55 - | crate::protocol_serde::shape_http_string_payload2::de_http_string_payload2_http_request(
|
56 - | request,
|
57 - | )
|
58 - | .await
|
59 - | .map_err(Into::into)
|
60 - | };
|
61 - | use ::futures_util::future::TryFutureExt;
|
62 - | let fut = fut.map_err(
|
63 - | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
64 - | ::tracing::debug!(error = %e, "failed to deserialize request");
|
65 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
66 - | e,
|
67 - | )
|
68 - | },
|
69 - | );
|
70 - | HttpStringPayload2InputFuture {
|
71 - | inner: Box::pin(fut),
|
72 - | }
|
73 - | }
|
74 - | }
|
75 - | impl
|
76 - | ::aws_smithy_http_server::response::IntoResponse<
|
77 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
78 - | > for crate::output::HttpStringPayload2Output
|
79 - | {
|
80 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
81 - | match crate::protocol_serde::shape_http_string_payload2::ser_http_string_payload2_http_response(self) {
|
82 - | Ok(response) => response,
|
83 - | Err(e) => {
|
84 - | ::tracing::error!(error = %e, "failed to serialize response");
|
85 - | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
86 - | }
|
87 - | }
|
88 - | }
|
89 - | }
|
90 - | impl
|
91 - | ::aws_smithy_http_server::response::IntoResponse<
|
92 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
93 - | > for crate::error::HttpStringPayload2Error
|
94 - | {
|
95 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
96 - | match crate::protocol_serde::shape_http_string_payload2::ser_http_string_payload2_http_error(
|
97 - | &self,
|
98 - | ) {
|
99 - | Ok(mut response) => {
|
100 - | response.extensions_mut().insert(
|
101 - | ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
|
102 - | );
|
103 - | response
|
104 - | }
|
105 - | Err(e) => {
|
106 - | ::tracing::error!(error = %e, "failed to serialize response");
|
107 - | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
108 - | }
|
109 - | }
|
110 - | }
|
111 - | }
|
112 - |
|
113 - | static CONTENT_TYPE_HTTPENUMPAYLOAD2: ::once_cell::sync::Lazy<::mime::Mime> =
|
114 - | ::once_cell::sync::Lazy::new(|| {
|
115 - | "text/plain"
|
116 - | .parse::<::mime::Mime>()
|
117 - | .expect("BUG: MIME parsing failed, content_type is not valid")
|
118 - | });
|
119 - | ::pin_project_lite::pin_project! {
|
120 - | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
121 - | /// [`HttpEnumPayload2Input`](crate::input::HttpEnumPayload2Input) using modelled bindings.
|
122 - | pub struct HttpEnumPayload2InputFuture {
|
123 - | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpEnumPayload2Input, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
124 - | }
|
125 - | }
|
126 - |
|
127 - | impl std::future::Future for HttpEnumPayload2InputFuture {
|
128 - | type Output = Result<
|
129 - | crate::input::HttpEnumPayload2Input,
|
130 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
131 - | >;
|
132 - |
|
133 - | fn poll(
|
134 - | self: std::pin::Pin<&mut Self>,
|
135 - | cx: &mut std::task::Context<'_>,
|
136 - | ) -> std::task::Poll<Self::Output> {
|
137 - | let this = self.project();
|
138 - | this.inner.as_mut().poll(cx)
|
139 - | }
|
140 - | }
|
141 - |
|
142 - | impl<B>
|
143 - | ::aws_smithy_http_server::request::FromRequest<
|
144 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
145 - | B,
|
146 - | > for crate::input::HttpEnumPayload2Input
|
147 - | where
|
148 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
149 - | B: 'static,
|
150 - |
|
151 - | B::Data: Send,
|
152 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
153 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
154 - | {
|
155 - | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
156 - | type Future = HttpEnumPayload2InputFuture;
|
157 - |
|
158 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
159 - | let fut = async move {
|
160 - | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
161 - | request.headers(),
|
162 - | &CONTENT_TYPE_HTTPENUMPAYLOAD2,
|
163 - | ) {
|
164 - | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
165 - | }
|
166 - | crate::protocol_serde::shape_http_enum_payload2::de_http_enum_payload2_http_request(
|
167 - | request,
|
168 - | )
|
169 - | .await
|
170 - | .map_err(Into::into)
|
171 - | };
|
172 - | use ::futures_util::future::TryFutureExt;
|
173 - | let fut = fut.map_err(
|
174 - | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
175 - | ::tracing::debug!(error = %e, "failed to deserialize request");
|
176 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
177 - | e,
|
178 - | )
|
179 - | },
|
180 - | );
|
181 - | HttpEnumPayload2InputFuture {
|
182 - | inner: Box::pin(fut),
|
183 - | }
|
184 - | }
|
185 - | }
|
186 - | impl
|
187 - | ::aws_smithy_http_server::response::IntoResponse<
|
188 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
189 - | > for crate::output::HttpEnumPayload2Output
|
190 - | {
|
191 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
192 - | match crate::protocol_serde::shape_http_enum_payload2::ser_http_enum_payload2_http_response(
|
193 - | self,
|
194 - | ) {
|
195 - | Ok(response) => response,
|
196 - | Err(e) => {
|
197 - | ::tracing::error!(error = %e, "failed to serialize response");
|
198 - | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
199 - | }
|
200 - | }
|
201 - | }
|
202 - | }
|
203 - | impl
|
204 - | ::aws_smithy_http_server::response::IntoResponse<
|
205 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
206 - | > for crate::error::HttpEnumPayload2Error
|
207 - | {
|
208 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
209 - | match crate::protocol_serde::shape_http_enum_payload2::ser_http_enum_payload2_http_error(
|
210 - | &self,
|
211 - | ) {
|
212 - | Ok(mut response) => {
|
213 - | response.extensions_mut().insert(
|
214 - | ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
|
215 - | );
|
216 - | response
|
217 - | }
|
218 - | Err(e) => {
|
219 - | ::tracing::error!(error = %e, "failed to serialize response");
|
220 - | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
221 - | }
|
222 - | }
|
223 - | }
|
224 - | }
|
225 - |
|
226 - | const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHBODY2: ::mime::Mime = ::mime::APPLICATION_JSON;
|
227 - | ::pin_project_lite::pin_project! {
|
228 - | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
229 - | /// [`MalformedContentTypeWithBody2Input`](crate::input::MalformedContentTypeWithBody2Input) using modelled bindings.
|
230 - | pub struct MalformedContentTypeWithBody2InputFuture {
|
231 - | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithBody2Input, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
232 - | }
|
233 - | }
|
234 - |
|
235 - | impl std::future::Future for MalformedContentTypeWithBody2InputFuture {
|
236 - | type Output = Result<
|
237 - | crate::input::MalformedContentTypeWithBody2Input,
|
238 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
239 - | >;
|
240 - |
|
241 - | fn poll(
|
242 - | self: std::pin::Pin<&mut Self>,
|
243 - | cx: &mut std::task::Context<'_>,
|
244 - | ) -> std::task::Poll<Self::Output> {
|
245 - | let this = self.project();
|
246 - | this.inner.as_mut().poll(cx)
|
247 - | }
|
248 - | }
|
249 - |
|
250 - | impl<B>
|
251 - | ::aws_smithy_http_server::request::FromRequest<
|
252 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
253 - | B,
|
254 - | > for crate::input::MalformedContentTypeWithBody2Input
|
255 - | where
|
256 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
257 - | B: 'static,
|
258 - |
|
259 - | B::Data: Send,
|
260 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
261 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
262 - | {
|
263 - | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
264 - | type Future = MalformedContentTypeWithBody2InputFuture;
|
265 - |
|
266 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
267 - | let fut = async move {
|
268 - | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
269 - | request.headers(),
|
270 - | &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHBODY2,
|
271 - | ) {
|
272 - | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
273 - | }
|
274 - | crate::protocol_serde::shape_malformed_content_type_with_body2::de_malformed_content_type_with_body2_http_request(request)
|
275 - | .await
|
276 - | .map_err(Into::into)
|
277 - | };
|
278 - | use ::futures_util::future::TryFutureExt;
|
279 - | let fut = fut.map_err(
|
280 - | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
281 - | ::tracing::debug!(error = %e, "failed to deserialize request");
|
282 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
283 - | e,
|
284 - | )
|
285 - | },
|
286 - | );
|
287 - | MalformedContentTypeWithBody2InputFuture {
|
288 - | inner: Box::pin(fut),
|
289 - | }
|
290 - | }
|
291 - | }
|
292 - | impl
|
293 - | ::aws_smithy_http_server::response::IntoResponse<
|
294 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
295 - | > for crate::output::MalformedContentTypeWithBody2Output
|
296 - | {
|
297 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
298 - | match crate::protocol_serde::shape_malformed_content_type_with_body2::ser_malformed_content_type_with_body2_http_response(self) {
|
299 - | Ok(response) => response,
|
300 - | Err(e) => {
|
301 - | ::tracing::error!(error = %e, "failed to serialize response");
|
302 - | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
303 - | }
|
304 - | }
|
305 - | }
|
306 - | }
|
307 - | impl
|
308 - | ::aws_smithy_http_server::response::IntoResponse<
|
309 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
310 - | > for crate::error::MalformedContentTypeWithBody2Error
|
311 - | {
|
312 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
313 - | match crate::protocol_serde::shape_malformed_content_type_with_body2::ser_malformed_content_type_with_body2_http_error(&self) {
|
314 - | Ok(mut response) => {
|
315 - | response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
|
316 - | response
|
317 - | },
|
318 - | Err(e) => {
|
319 - | ::tracing::error!(error = %e, "failed to serialize response");
|
320 - | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
321 - | }
|
322 - | }
|
323 - | }
|
324 - | }
|
325 - |
|
326 - | ::pin_project_lite::pin_project! {
|
327 - | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
328 - | /// [`HttpPayloadTraits2Input`](crate::input::HttpPayloadTraits2Input) using modelled bindings.
|
329 - | pub struct HttpPayloadTraits2InputFuture {
|
330 - | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadTraits2Input, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
331 - | }
|
332 - | }
|
333 - |
|
334 - | impl std::future::Future for HttpPayloadTraits2InputFuture {
|
335 - | type Output = Result<
|
336 - | crate::input::HttpPayloadTraits2Input,
|
337 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
338 - | >;
|
339 - |
|
340 - | fn poll(
|
341 - | self: std::pin::Pin<&mut Self>,
|
342 - | cx: &mut std::task::Context<'_>,
|
343 - | ) -> std::task::Poll<Self::Output> {
|
344 - | let this = self.project();
|
345 - | this.inner.as_mut().poll(cx)
|
346 - | }
|
347 - | }
|
348 - |
|
349 - | impl<B>
|
350 - | ::aws_smithy_http_server::request::FromRequest<
|
351 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
352 - | B,
|
353 - | > for crate::input::HttpPayloadTraits2Input
|
354 - | where
|
355 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
356 - | B: 'static,
|
357 - |
|
358 - | B::Data: Send,
|
359 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
360 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
361 - | {
|
362 - | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
363 - | type Future = HttpPayloadTraits2InputFuture;
|
364 - |
|
365 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
366 - | let fut = async move {
|
367 - | crate::protocol_serde::shape_http_payload_traits2::de_http_payload_traits2_http_request(
|
368 - | request,
|
369 - | )
|
370 - | .await
|
371 - | .map_err(Into::into)
|
372 - | };
|
373 - | use ::futures_util::future::TryFutureExt;
|
374 - | let fut = fut.map_err(
|
375 - | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
376 - | ::tracing::debug!(error = %e, "failed to deserialize request");
|
377 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
378 - | e,
|
379 - | )
|
380 - | },
|
381 - | );
|
382 - | HttpPayloadTraits2InputFuture {
|
383 - | inner: Box::pin(fut),
|
384 - | }
|
385 - | }
|
386 - | }
|
387 - | impl
|
388 - | ::aws_smithy_http_server::response::IntoResponse<
|
389 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
390 - | > for crate::output::HttpPayloadTraits2Output
|
391 - | {
|
392 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
393 - | match crate::protocol_serde::shape_http_payload_traits2::ser_http_payload_traits2_http_response(self) {
|
394 - | Ok(response) => response,
|
395 - | Err(e) => {
|
396 - | ::tracing::error!(error = %e, "failed to serialize response");
|
397 - | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
398 - | }
|
399 - | }
|
400 - | }
|
401 - | }
|
402 - | impl
|
403 - | ::aws_smithy_http_server::response::IntoResponse<
|
404 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
405 - | > for crate::error::HttpPayloadTraits2Error
|
406 - | {
|
407 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
408 - | match crate::protocol_serde::shape_http_payload_traits2::ser_http_payload_traits2_http_error(
|
409 - | &self,
|
410 - | ) {
|
411 - | Ok(mut response) => {
|
412 - | response.extensions_mut().insert(
|
413 - | ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
|
414 - | );
|
415 - | response
|
416 - | }
|
417 - | Err(e) => {
|
418 - | ::tracing::error!(error = %e, "failed to serialize response");
|
419 - | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
420 - | }
|
421 - | }
|
422 - | }
|
423 - | }
|
424 - |
|
425 2 | const CONTENT_TYPE_QUERYPRECEDENCE: ::mime::Mime = ::mime::APPLICATION_JSON;
|
426 3 | ::pin_project_lite::pin_project! {
|
427 4 | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
428 5 | /// [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput) using modelled bindings.
|
429 6 | pub struct QueryPrecedenceInputFuture {
|
430 7 | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::QueryPrecedenceInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
431 8 | }
|
432 9 | }
|
433 10 |
|
434 11 | impl std::future::Future for QueryPrecedenceInputFuture {
|