pub struct TransportResponse<'response, 'storage> { /* private fields */ }Expand description
Borrowed view committed from an admitted writer.
Safe callers cannot construct a response from unrelated storage.
ⓘ
use cloud_sdk::transport::{StatusCode, TransportResponse};
let external = b"unadmitted";
let _ = TransportResponse {
status: StatusCode::OK,
body: external,
metadata: unreachable!(),
};Implementations§
Source§impl<'response, 'storage> TransportResponse<'response, 'storage>
impl<'response, 'storage> TransportResponse<'response, 'storage>
Sourcepub const fn status(&self) -> StatusCode
pub const fn status(&self) -> StatusCode
Returns the status code.
Sourcepub fn content_type(
&self,
) -> Result<Option<ResponseContentType<'response>>, ContentTypeError>
pub fn content_type( &self, ) -> Result<Option<ResponseContentType<'response>>, ContentTypeError>
Returns the validated response content type when supplied.
A present malformed value is an error, never an absent header.
Sourcepub const fn rate_limit(&self) -> Option<RateLimit>
pub const fn rate_limit(&self) -> Option<RateLimit>
Returns validated rate-limit metadata when supplied.
Sourcepub const fn headers(&self) -> &'response ResponseHeaders<'storage>
pub const fn headers(&self) -> &'response ResponseHeaders<'storage>
Returns complete bounded response-header metadata.
Sourcepub fn with_request_id<R>(&self, inspect: impl FnOnce(Option<&[u8]>) -> R) -> R
pub fn with_request_id<R>(&self, inspect: impl FnOnce(Option<&[u8]>) -> R) -> R
Runs a closure with a protected provider request identifier.
Trait Implementations§
Source§impl<'response, 'storage> Clone for TransportResponse<'response, 'storage>
impl<'response, 'storage> Clone for TransportResponse<'response, 'storage>
Source§fn clone(&self) -> TransportResponse<'response, 'storage>
fn clone(&self) -> TransportResponse<'response, 'storage>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'response, 'storage> Copy for TransportResponse<'response, 'storage>
Auto Trait Implementations§
impl<'response, 'storage> Freeze for TransportResponse<'response, 'storage>
impl<'response, 'storage> RefUnwindSafe for TransportResponse<'response, 'storage>
impl<'response, 'storage> Send for TransportResponse<'response, 'storage>
impl<'response, 'storage> Sync for TransportResponse<'response, 'storage>
impl<'response, 'storage> Unpin for TransportResponse<'response, 'storage>
impl<'response, 'storage> UnsafeUnpin for TransportResponse<'response, 'storage>
impl<'response, 'storage> UnwindSafe for TransportResponse<'response, 'storage>
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