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.
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 status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
The response status.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the wrapper, yielding the decoded body.
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>
Auto 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