Skip to main content

fetch_meta

Function fetch_meta 

Source
pub fn fetch_meta<T: Transport>(
    client: &Client<T>,
    now_s: u64,
) -> Result<(Meta, Fetched), MotorFinderError>
Expand description

Fetches meta.json through client.

The answer comes from the client’s cache while fresh (see Endpoint::source); offline, from the cache only. The Fetched says which, carries ATTRIBUTION and holds the body. Only an answer that parse_meta reads is cached (Client::fetch_checked): one that doesn’t never takes a good copy’s place, and online a stale good copy is returned instead, with the reason. The other fetch_ functions work the same way.

§Errors

MotorFinderError::Net when the fetch fails, or with NetError::Refused naming what the parser refused when the only answer there is doesn’t parse.