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
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