Struct aws_smithy_http::operation::Request
source · pub struct Request { /* private fields */ }
Expand description
Operation request type that associates a property bag with an underlying HTTP request.
This type represents the request in the Tower Service
in middleware so that middleware
can share information with each other via the properties.
Implementations§
source§impl Request
impl Request
sourcepub fn new(inner: Request<SdkBody>) -> Self
pub fn new(inner: Request<SdkBody>) -> Self
Creates a new operation Request
with the given inner
HTTP request.
sourcepub fn from_parts(inner: Request<SdkBody>, properties: SharedPropertyBag) -> Self
pub fn from_parts(inner: Request<SdkBody>, properties: SharedPropertyBag) -> Self
Creates a new operation Request
from its parts.
sourcepub fn augment<T>(
self,
f: impl FnOnce(Request<SdkBody>, &mut PropertyBag) -> Result<Request<SdkBody>, T>
) -> Result<Request, T>
pub fn augment<T>( self, f: impl FnOnce(Request<SdkBody>, &mut PropertyBag) -> Result<Request<SdkBody>, T> ) -> Result<Request, T>
Allows modification of the HTTP request and associated properties with a fallible closure.
sourcepub fn properties_mut(&mut self) -> impl DerefMut<Target = PropertyBag> + '_
pub fn properties_mut(&mut self) -> impl DerefMut<Target = PropertyBag> + '_
Gives mutable access to the properties.
sourcepub fn properties(&self) -> impl Deref<Target = PropertyBag> + '_
pub fn properties(&self) -> impl Deref<Target = PropertyBag> + '_
Gives readonly access to the properties.
sourcepub fn http_mut(&mut self) -> &mut Request<SdkBody>
pub fn http_mut(&mut self) -> &mut Request<SdkBody>
Gives mutable access to the underlying HTTP request.
sourcepub fn try_clone(&self) -> Option<Request>
pub fn try_clone(&self) -> Option<Request>
Attempts to clone the operation Request
. This can fail if the
request body can’t be cloned, such as if it is being streamed and the
stream can’t be recreated.
sourcepub fn into_parts(self) -> (Request<SdkBody>, SharedPropertyBag)
pub fn into_parts(self) -> (Request<SdkBody>, SharedPropertyBag)
Consumes the operation Request
and returns the underlying HTTP request and properties.