Enum mqtt_async_client::client::KeepAlive[][src]

pub enum KeepAlive {
    Disabled,
    Enabled {
        secs: u16,
    },
}
Expand description

Represents the keep alive setting for a client.

Variants

Disabled

Keep alive ping packets are disabled.

Enabled

Send a keep alive ping packet every secs seconds.

Fields of Enabled

secs: u16

The number of seconds between packets.

Implementations

Set keep alive time in seconds.

Panics if secs parameter is 0.

Disable keep alive functionality.

Returns whether keep alives are enabled.

Returns whether keep alives are disabled.

Returns the keep alive interval if enabled as Some(tokio::Duration), or None if disabled.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.