pub struct EndpointResult<T: DeserializeOwned + Send + Sync> {
pub response: Response<Vec<u8>>,
pub ty: ResponseType,
/* private fields */
}
Expand description
A response from executing an Endpoint.
All Endpoint executions will result in an EndpointResult which wraps
the actual HTTP Response and the final result type. The response can be
parsed into the final result type by calling parse()
or optionally
wrapped by a Wrapper by calling wrap()
.
Fields§
§response: Response<Vec<u8>>
§ty: ResponseType
Implementations§
Source§impl<T: DeserializeOwned + Send + Sync> EndpointResult<T>
impl<T: DeserializeOwned + Send + Sync> EndpointResult<T>
Sourcepub fn new(response: Response<Vec<u8>>, ty: ResponseType) -> Self
pub fn new(response: Response<Vec<u8>>, ty: ResponseType) -> Self
Returns a new EndpointResult.
Sourcepub fn parse(&self) -> Result<T, ClientError>
pub fn parse(&self) -> Result<T, ClientError>
Parses the response into the final result type.
Auto Trait Implementations§
impl<T> Freeze for EndpointResult<T>
impl<T> !RefUnwindSafe for EndpointResult<T>
impl<T> Send for EndpointResult<T>
impl<T> Sync for EndpointResult<T>
impl<T> Unpin for EndpointResult<T>where
T: Unpin,
impl<T> !UnwindSafe for EndpointResult<T>
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