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
Auto Trait Implementations§
impl<'a> Freeze for DisconnectOpts<'a>
impl<'a> RefUnwindSafe for DisconnectOpts<'a>
impl<'a> Send for DisconnectOpts<'a>
impl<'a> Sync for DisconnectOpts<'a>
impl<'a> Unpin for DisconnectOpts<'a>
impl<'a> UnwindSafe for DisconnectOpts<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more