Struct rustify::endpoint::EndpointResult
source · [−]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: ResponseTypeImplementations
sourceimpl<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> !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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more