pub struct DisconnectOptions {
pub publish_will: bool,
pub session_expiry_interval: Option<SessionExpiryInterval>,
}Expand description
Options for a disconnection to the server with a DISCONNECT packet.
Fields§
§publish_will: boolIf set to true, the server publishes the will message.
session_expiry_interval: Option<SessionExpiryInterval>The session expiry interval property. Not allowed to be set to a non-zero value if the session expiry interval property in the CONNECT packet has been 0. This value overrides the session expiry interval negotiated in the handshake.
Implementations§
Source§impl Options
impl Options
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates new disconnect options with will publication disabled and no session expiry interval.
Sourcepub const fn publish_will(self) -> Self
pub const fn publish_will(self) -> Self
Sets the publish will flag to true.
Sourcepub const fn session_expiry_interval(
self,
interval: SessionExpiryInterval,
) -> Self
pub const fn session_expiry_interval( self, interval: SessionExpiryInterval, ) -> Self
Sets the session expiry interval property.
Trait Implementations§
impl Copy for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more