Enum hiirc::ReconnectionSettings
[−]
[src]
pub enum ReconnectionSettings { DoNotReconnect, Reconnect { max_attempts: u32, delay_between_attempts: Duration, delay_after_disconnect: Duration, }, }
These settings tell the reconnection process how to behave.
Default is implemented for this type, with fairly sensible settings. See the Default trait implementation.
Variants
DoNotReconnect
Don't try to reconnect after failure.
Reconnect
Reconnect
Fields of Reconnect
max_attempts: u32 | After trying this amount of times, it will stop trying. A value of 0 means infinite attempts. |
delay_between_attempts: Duration | Wait time between two attempts to reconnect in milliseconds. Note that if the computer's network is still unavailable, the connect call might block for about a minute until it fails. Somtimes, it fails instantly because it cannot resolve the hostname. You should probably leave at least a second of delay, so that it doesn't loop really fast while getting hostname resolution errors. You can watch the stream of errors via the ReconnectionError event. |
delay_after_disconnect: Duration | Wait time after disconnection, before trying to reconnect. |
Trait Implementations
impl Default for ReconnectionSettings
[src]
Default settings are provided for this enum.
They are:
max_attempts
= 10
delay_between_attempts
= 5 seconds
delay_after_disconnect
= 60 seconds
fn default() -> ReconnectionSettings
impl Copy for ReconnectionSettings
[src]
impl Eq for ReconnectionSettings
[src]
impl PartialEq<ReconnectionSettings> for ReconnectionSettings
[src]
fn eq(&self, __arg_0: &ReconnectionSettings) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ReconnectionSettings) -> bool
This method tests for !=
.
impl Debug for ReconnectionSettings
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl Clone for ReconnectionSettings
[src]
fn clone(&self) -> ReconnectionSettings
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more