Skip to main content

fetch

Function fetch 

Source
pub fn fetch<T: Transport>(
    client: &Client<T>,
    request: &NomadsRequest,
    now_s: u64,
) -> Result<(NomadsProfile, Fetched), NomadsError>
Expand description

Fetches request through client and reads it at the request’s site.

The answer comes from the client’s cache while fresh; offline, from the cache only. Only an answer that decodes, builds a sounding, and is for the cycle and forecast hour asked is cached (Client::fetch_checked).

§Errors

NomadsError::Request for a bad request; NomadsError::Net when the fetch fails, or with NetError::Refused naming what was refused when the only answer there is doesn’t pass.