pub struct TransactionStreamRequest { /* private fields */ }Expand description
Builder for Client::transaction_stream.
Implementations§
Source§impl TransactionStreamRequest
impl TransactionStreamRequest
Sourcepub fn auto_reconnect(self, enabled: bool) -> Self
pub fn auto_reconnect(self, enabled: bool) -> Self
Enables or disables automatic reconnection (enabled by default). When disabled, the stream ends on the first connection problem.
Sourcepub fn heartbeat_timeout(self, timeout: Duration) -> Self
pub fn heartbeat_timeout(self, timeout: Duration) -> Self
How long without any line (heartbeats arrive every 5s) before the connection is considered stale and replaced. Default 10s.
Sourcepub fn backoff(self, initial: Duration, max: Duration) -> Self
pub fn backoff(self, initial: Duration, max: Duration) -> Self
Sets the reconnect backoff: the delay starts at initial and
doubles (with jitter) up to max. Defaults: 1s → 5 minutes.
The 5-minute default cap keeps retry traffic negligible across
extended outages such as OANDA’s weekend maintenance windows.
Sourcepub fn backoff_reset_after(self, stable: Duration) -> Self
pub fn backoff_reset_after(self, stable: Duration) -> Self
How long a connection must stay healthy before the backoff resets to its initial delay (default 60s). Prevents connect/die/connect churn from bypassing the cooldown.
Sourcepub fn max_reconnect_attempts(self, attempts: u32) -> Self
pub fn max_reconnect_attempts(self, attempts: u32) -> Self
Limits the number of consecutive failed reconnect attempts before the stream gives up with an error. Default: unlimited (rides out arbitrarily long outages).
Sourcepub async fn send(self) -> Result<TransactionStream, Error>
pub async fn send(self) -> Result<TransactionStream, Error>
Connects and returns the managed stream. Fails fast when the initial connection is rejected (e.g. bad token or account).