Skip to main content

fetch

Function fetch 

Source
pub async fn fetch(
    host: &Url,
    version: Version,
    client: &Client,
) -> Result<NodeInfo, Error>
Available on crate feature client only.
Expand description

Fetches a NodeInfo document at version from host.

Resolves the concrete schema URL via the discovery document and then fetches and parses the NodeInfo JSON, enforcing DEFAULT_MAX_BODY_BYTES on both requests.

ยงErrors

Returns Error::VersionNotAdvertised if the server does not advertise the requested version, and propagates transport / parse errors via Error::Http / Error::Json / Error::BadStatus / Error::ResponseTooLarge.