[−][src]Function screeps_api::connecting::interpret
pub fn interpret<R>(
tokens: TokenStorage,
url: Url,
response: ResponseFuture
) -> FutureResponse<R> where
R: EndpointType,
Interpret a hyper result as the result from a specific endpoint.
The returned future will:
- Wait for the hyper request to finish
- Wait for hyper request body, collecting it into a single chunk
- Parse JSON body as the given
EndpointType
, and return result/error.
All errors returned will have the given Url
contained as part of the context.
Parameters
url
: url that is being queried, used only for error and warning messagestokens
: where to put any tokens that were returned, if anyresponse
: actual hyper response that we're interpreting