Struct aws_smithy_runtime_api::http::Response
source · pub struct Response<B = SdkBody> { /* private fields */ }
Expand description
An HTTP Response Type
Implementations§
source§impl<B> Response<B>
impl<B> Response<B>
sourcepub fn try_into_http02x(self) -> Result<Response<B>, HttpError>
pub fn try_into_http02x(self) -> Result<Response<B>, HttpError>
Converts this response into an http 0.x response.
Depending on the internal storage type, this operation may be free or it may have an internal cost.
sourcepub fn try_into_http1x(self) -> Result<Response<B>, HttpError>
pub fn try_into_http1x(self) -> Result<Response<B>, HttpError>
Converts this response into an http 1.x response.
Depending on the internal storage type, this operation may be free or it may have an internal cost.
sourcepub fn map<U>(self, f: impl Fn(B) -> U) -> Response<U>
pub fn map<U>(self, f: impl Fn(B) -> U) -> Response<U>
Update the body of this response to be a new body.
sourcepub fn new(status: StatusCode, body: B) -> Self
pub fn new(status: StatusCode, body: B) -> Self
Returns a response with the given status and body
sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Returns the status code
sourcepub fn status_mut(&mut self) -> &mut StatusCode
pub fn status_mut(&mut self) -> &mut StatusCode
Returns a mutable reference to the status code
sourcepub fn headers_mut(&mut self) -> &mut Headers
pub fn headers_mut(&mut self) -> &mut Headers
Returns a mutable reference to the header map
sourcepub fn add_extension<T: Send + Sync + Clone + 'static>(&mut self, extension: T)
pub fn add_extension<T: Send + Sync + Clone + 'static>(&mut self, extension: T)
Adds an extension to the response extensions
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Response<B>where
B: Freeze,
impl<B = SdkBody> !RefUnwindSafe for Response<B>
impl<B> Send for Response<B>where
B: Send,
impl<B> Sync for Response<B>where
B: Sync,
impl<B> Unpin for Response<B>where
B: Unpin,
impl<B = SdkBody> !UnwindSafe for Response<B>
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
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Creates a shared type from an unshared type.