[−][src]Enum mqtt_async_client::client::KeepAlive
Represents the keep alive setting for a client.
Variants
Keep alive ping packets are disabled.
Send a keep alive ping packet every secs
seconds.
Fields of Enabled
secs: u16
The number of seconds between packets.
Methods
impl KeepAlive
[src]
pub fn from_secs(secs: u16) -> KeepAlive
[src]
Set keep alive time in seconds.
Panics if secs
parameter is 0.
pub fn disabled() -> KeepAlive
[src]
Disable keep alive functionality.
pub fn is_enabled(&self) -> bool
[src]
Returns whether keep alives are enabled.
pub fn is_disabled(&self) -> bool
[src]
Returns whether keep alives are disabled.
pub fn as_duration(&self) -> Option<Duration>
[src]
Returns the keep alive interval if enabled as Some(tokio::Duration), or None if disabled.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for KeepAlive
impl Send for KeepAlive
impl Sync for KeepAlive
impl Unpin for KeepAlive
impl UnwindSafe for KeepAlive
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,