Expand description
HTTP/HTTPS ResourceFetcher / AsyncResourceFetcher for the roas
OpenAPI loader.
The generic Fetcher<C> is parameterised over the underlying
reqwest client type. Two concrete aliases cover the common cases:
HttpFetcher(=Fetcher<reqwest::blocking::Client>) — synchronous; use withLoader::register_fetcher.AsyncHttpFetcher(=Fetcher<reqwest::Client>) — async; use withLoader::register_async_fetcher. A tokio runtime must be active when the returned future is awaited.
Both forms are Clone so a single fetcher can be registered for both
http:// and https:// prefixes, sharing one underlying connection pool.
Transport failures, non-2xx responses, and unreadable bodies are surfaced
through LoaderError::Fetch with a HttpFetchError source. Schemes
other than http / https are rejected with
LoaderError::UnsupportedFetcherUri.
With the yaml feature enabled, both forms parse YAML response bodies in
addition to JSON. Format selection sniffs the response Content-Type
header first and falls back to the URL path extension (.yaml / .yml).
Structs§
- Fetcher
- HTTP/HTTPS fetcher generic over the underlying
reqwestclient.
Enums§
- Http
Fetch Error - Transport-layer failure exposed by
HttpFetcher.
Type Aliases§
- Async
Http Fetcher - Async HTTP/HTTPS fetcher, suitable for
Loader::register_async_fetcher. A tokio runtime must be active when the returned future is awaited. - Http
Fetcher - Blocking HTTP/HTTPS fetcher, suitable for
Loader::register_fetcher.