Loading rust-runtime/aws-smithy-http/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ http-body = "0.4.4" once_cell = "1.10" percent-encoding = "2.1.0" pin-project-lite = "0.2.9" pin-utils = "0.1.0" tracing = "0.1" # We are using hyper for our streaming body implementation, but this is an internal detail. Loading rust-runtime/aws-smithy-http/src/byte_stream.rs +1 −1 Original line number Diff line number Diff line Loading @@ -544,7 +544,7 @@ impl<B> Inner<B> { { let mut output = SegmentedBuf::new(); let body = self.body; crate::pin_mut!(body); pin_utils::pin_mut!(body); while let Some(buf) = body.data().await { output.push(buf?); } Loading rust-runtime/aws-smithy-http/src/lib.rs +0 −1 Original line number Diff line number Diff line Loading @@ -36,5 +36,4 @@ pub mod event_stream; pub mod byte_stream; mod pin_util; mod urlencode; rust-runtime/aws-smithy-http/src/middleware.rs +1 −1 Original line number Diff line number Diff line Loading @@ -10,11 +10,11 @@ use crate::body::SdkBody; use crate::operation; use crate::pin_mut; use crate::response::ParseHttpResponse; use crate::result::{SdkError, SdkSuccess}; use bytes::{Buf, Bytes}; use http_body::Body; use pin_utils::pin_mut; use std::error::Error; use std::future::Future; use tracing::trace; Loading rust-runtime/aws-smithy-http/src/pin_util.rsdeleted 100644 → 0 +0 −30 Original line number Diff line number Diff line /* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ /// Pins a value on the stack. /// /// # Examples /// /// ```rust /// # use core::pin::Pin; /// # struct Foo {} /// # use aws_smithy_http::pin_mut; /// let foo = Foo { /* ... */ }; /// pin_mut!(foo); /// let _: Pin<&mut Foo> = foo; /// ``` #[macro_export] macro_rules! pin_mut { ($($x:ident),* $(,)?) => { $( // Move the value to ensure that it is owned let mut $x = $x; // Shadow the original binding so that it can't be directly accessed // ever again. #[allow(unused_mut)] let mut $x = unsafe { core::pin::Pin::new_unchecked(&mut $x) }; )* } } Loading
rust-runtime/aws-smithy-http/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ http-body = "0.4.4" once_cell = "1.10" percent-encoding = "2.1.0" pin-project-lite = "0.2.9" pin-utils = "0.1.0" tracing = "0.1" # We are using hyper for our streaming body implementation, but this is an internal detail. Loading
rust-runtime/aws-smithy-http/src/byte_stream.rs +1 −1 Original line number Diff line number Diff line Loading @@ -544,7 +544,7 @@ impl<B> Inner<B> { { let mut output = SegmentedBuf::new(); let body = self.body; crate::pin_mut!(body); pin_utils::pin_mut!(body); while let Some(buf) = body.data().await { output.push(buf?); } Loading
rust-runtime/aws-smithy-http/src/lib.rs +0 −1 Original line number Diff line number Diff line Loading @@ -36,5 +36,4 @@ pub mod event_stream; pub mod byte_stream; mod pin_util; mod urlencode;
rust-runtime/aws-smithy-http/src/middleware.rs +1 −1 Original line number Diff line number Diff line Loading @@ -10,11 +10,11 @@ use crate::body::SdkBody; use crate::operation; use crate::pin_mut; use crate::response::ParseHttpResponse; use crate::result::{SdkError, SdkSuccess}; use bytes::{Buf, Bytes}; use http_body::Body; use pin_utils::pin_mut; use std::error::Error; use std::future::Future; use tracing::trace; Loading
rust-runtime/aws-smithy-http/src/pin_util.rsdeleted 100644 → 0 +0 −30 Original line number Diff line number Diff line /* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ /// Pins a value on the stack. /// /// # Examples /// /// ```rust /// # use core::pin::Pin; /// # struct Foo {} /// # use aws_smithy_http::pin_mut; /// let foo = Foo { /* ... */ }; /// pin_mut!(foo); /// let _: Pin<&mut Foo> = foo; /// ``` #[macro_export] macro_rules! pin_mut { ($($x:ident),* $(,)?) => { $( // Move the value to ensure that it is owned let mut $x = $x; // Shadow the original binding so that it can't be directly accessed // ever again. #[allow(unused_mut)] let mut $x = unsafe { core::pin::Pin::new_unchecked(&mut $x) }; )* } }