Enum fred::types::ReconnectPolicy [] [src]

pub enum ReconnectPolicy {
    Constant {
        attempts: u32,
        max_attempts: u32,
        delay: u32,
    },
    Linear {
        attempts: u32,
        max_attempts: u32,
        max: u32,
        delay: u32,
    },
    Exponential {
        attempts: u32,
        max_attempts: u32,
        min: u32,
        max: u32,
        mult: u32,
    },
}

The type of reconnection policy to use. This will apply to every connection used by the client.

attempts should be initialized with 0 but it doesn't really matter, the client will reset it as needed.

min and max refer to the min and max delay to use when reconnecting. These can be used to put bounds around the amount of time between attempts.

Use a max_attempts value of 0 to retry forever.

Variants

Wait a constant amount of time between reconnect attempts, in ms.

Fields of Constant

Backoff reconnection attempts linearly, adding delay each time.

Fields of Linear

Backoff reconnection attempts exponentially, multiplying the last delay by mult each time.

Fields of Exponential

Methods

impl ReconnectPolicy
[src]

[src]

Reset the number of reconnection attempts. It's unlikely users will need to call this.

[src]

Read the number of reconnection attempts.

[src]

Calculate the next delay, incrementing attempts in the process. It's unlikely users will need to call this.

Trait Implementations

impl Clone for ReconnectPolicy
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for ReconnectPolicy
[src]

[src]

Formats the value using the given formatter.

impl Eq for ReconnectPolicy
[src]

impl PartialEq for ReconnectPolicy
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.