Skip to main content
NexusConfig implements Default, so build it with ..Default::default() - a new option in a later release then does not touch your call site.

Options

*api_key may be empty when wif.enabled = true.

Validation happens once, at construction

Every option is resolved and checked before the client exists. A rejection names the option and, for list options, the index - so the mistake is visible immediately instead of resurfacing days later as unexplained load or a stalled stream:
Rejected values: an empty endpoint, an unparseable URL, a URL with no host, plain http on a non-loopback host, no credential at all, a ttl under one second, a 0 cooldown entry, and a cooldown above 24 hours.

Endpoint URL

The SDK sends the host as the Host header on every request (Double-Gate validation).

Choosing a TTL

With run_stream() active, events keep the cache fresh and the timer acts as a fallback - the configured interval still applies exactly as set.

Keeping the key secure

NexusClient implements Debug with the credential redacted, so logging the client cannot leak it. The SDK’s own tracing output never carries a key, a token, a secret value or even a secret’s key name.

WifConfig

WifConfig also implements Default.

Timeouts and limits

These are not configurable; they are chosen to match the backend’s behaviour.