Struct poster::DisconnectOpts
source · pub struct DisconnectOpts<'a> { /* private fields */ }Expand description
Disconnection options, represented as a consuming builder. Used during disconnection request, translated to the DISCONNECT packet.
Implementations§
source§impl<'a> DisconnectOpts<'a>
impl<'a> DisconnectOpts<'a>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new DisconnectOpts instance.
sourcepub fn reason(self, reason: DisconnectReason) -> Self
pub fn reason(self, reason: DisconnectReason) -> Self
Sets a reason for disconnection.
sourcepub fn session_expiry_interval(self, val: Duration) -> Self
pub fn session_expiry_interval(self, val: Duration) -> Self
sourcepub fn reason_string(self, val: &'a str) -> Self
pub fn reason_string(self, val: &'a str) -> Self
Sets a reason string property.
sourcepub fn user_property(self, (key, val): (&'a str, &'a str)) -> Self
pub fn user_property(self, (key, val): (&'a str, &'a str)) -> Self
Sets user properties. Multiple user properties may be set.
Trait Implementations§
source§impl<'a> Default for DisconnectOpts<'a>
impl<'a> Default for DisconnectOpts<'a>
source§fn default() -> DisconnectOpts<'a>
fn default() -> DisconnectOpts<'a>
Returns the “default value” for a type. Read more