INNER CODE UNIT · Rust
connect_attempt_timeout
pbeets/rithmic-rs · src/config.rs:644
pub fn connect_attempt_timeout(mut self, timeout: Duration) -> Self {
self.connect_attempt_timeout = if timeout.is_zero() {
DEFAULT_CONNECT_ATTEMPT_TIMEOUT
} else {
timeout
};
self
}
/// Give up connecting after `timeout` instead of retrying forever.
///
/// The timeout covers every attempt and backoff together. For the limit on
/// one attempt, see
/// [`connect_attempt_timeout`](Self::connect_attempt_timeout).
///
/// It bounds only `connect()`. `login()` and requests never time out; wrap
/// them in `tokio::time::timeout` (see `examples/request_timeout.rs`).