Skip to main content

Module client

Module client 

Source
Expand description

Authenticated TaskFast client.

TaskFastClient wraps the progenitor-generated crate::api::Client with the cross-cutting concerns the generated code deliberately omits:

  1. Auth — injects X-API-Key on every request via reqwest’s default_headers, so every generated method call carries it without per-call plumbing.
  2. Typed errors — translates crate::api::Error<()> into crate::errors::Error by reading the response body of an UnexpectedResponse and classifying by status code. The normalizer strips non-2xx response declarations from the spec (see xtask::normalize_spec), so every TaskFast failure arrives here as UnexpectedResponse — we are the single funnel.
  3. Retry — TaskFastClient::call_with_retry runs a closure under the configured RetryPolicy, honoring 429 Retry-After and retrying 5xx with exponential backoff.

Direct access to the generated client is available via TaskFastClient::inner so callers can invoke client.inner().get_agent_profile().await and then pipe the result through map_api_error or the retry wrapper as they prefer.

Structs§

NetworkConfigEntry
Chain metadata for a single Tempo network.
NetworkConfigResponse
Per-network chain configuration returned by GET /config/network.
TaskFastClient
Authenticated TaskFast API client.
UserProfile
Owning human’s display name + email, returned by GET /users/me. Lives alongside the hand-rolled fetch until the endpoint is added to spec/openapi.yaml and the type can be regenerated under crate::api::types.

Functions§

map_api_error
Translate a progenitor api::Error<()> into a typed Error.