Skip to main content

Module api

Module api 

Source
Expand description

API definitions and related utilities.

§Observability

Two independent, additive, opt-in hooks:

  • tracing feature — instruments Client::get / [sync::Client::get] with a span (method, endpoint, attempt, status) and debug events on each retry (backoff delay, transient status/error). Off by default and compiles away entirely (no tracing dependency pulled in) when disabled. The API key is never recorded — Client’s Debug impl already redacts it, and no span/event field ever carries it.
  • Custom HTTP clientClientBuilder::http_client / [sync::ClientBuilder::http_client] let callers supply their own pre-built reqwest::Client, e.g. wrapped with reqwest-middleware for custom auth, metrics, or logging middleware. When omitted, the client falls back to the built-in defaults (User-Agent, unbounded idle pool, the configured timeout).

§Pagination

Client::paginate / [sync::Client::paginate] auto-paginate any [Paginated] response envelope, whether or not it reports a total (see [Paginated::total]). The async [Paginator] is a plain next_page() cursor by default; enabling the opt-in stream feature additionally implements Stream for it, so it composes with futures/StreamExt combinators and .next().await. Off by default and compiles away entirely (no futures-core dependency pulled in) when disabled. The blocking [sync::Paginator] already implements Iterator unconditionally.

Structs§

Client
The async client for interacting with the Datamaxi+ API.
ClientBuilder
Builder for a Client, giving control over the API key source, base URL, and request timeout.
Paginator
Async auto-paginator returned by Client::paginate.

Enums§

Error
Errors returned by the Datamaxi+ API client.

Traits§

Paginated
Implemented by paged response envelopes — the page/limit/data shape shared by several Datamaxi+ endpoints, with or without a total (e.g. CexAnnouncementsResponse reports total; FundingRateHistoryResponse does not) — so Client::paginate / [sync::Client::paginate] can drive a generic auto-paginator over them without codegen needing to emit a bespoke helper per endpoint.

Type Aliases§

Result
A specialized Result type for Datamaxi+ API calls.