pub struct ResponseValue<T> { /* private fields */ }Expand description
A successful response body paired with its status and headers. Returned inside
Result<ResponseValue<T>, Error<E>> from every generated operation method.
Its Debug prints the status, the headers and the body, with each Set-Cookie,
Authorization and Proxy-Authenticate value, and each value marked sensitive, printed as
[redacted], as Error’s Debug prints a response’s headers.
Implementations§
Source§impl<T> ResponseValue<T>
impl<T> ResponseValue<T>
Sourcepub fn new(status: StatusCode, headers: HeaderMap, inner: T) -> Self
pub fn new(status: StatusCode, headers: HeaderMap, inner: T) -> Self
Wrap a decoded body with its status and headers.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the wrapper, yielding the decoded body.
Sourcepub fn into_parts(self) -> (StatusCode, HeaderMap, T)
pub fn into_parts(self) -> (StatusCode, HeaderMap, T)
Consume the wrapper, yielding its status, headers and decoded body, each owned, so a caller
keeping the headers beside the body need not clone them before Self::into_inner.
Sourcepub fn map<U>(self, f: impl FnOnce(T) -> U) -> ResponseValue<U>
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> ResponseValue<U>
Map the body while preserving status and headers.
Trait Implementations§
Source§impl<T: Clone> Clone for ResponseValue<T>
impl<T: Clone> Clone for ResponseValue<T>
Source§fn clone(&self) -> ResponseValue<T>
fn clone(&self) -> ResponseValue<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for ResponseValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for ResponseValue<T>where
T: RefUnwindSafe,
impl<T> Send for ResponseValue<T>where
T: Send,
impl<T> Sync for ResponseValue<T>where
T: Sync,
impl<T> Unpin for ResponseValue<T>where
T: Unpin,
impl<T> UnsafeUnpin for ResponseValue<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ResponseValue<T>where
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Consume a handle, getting back the initial
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more