Struct UnsubscribeBuilder
pub struct UnsubscribeBuilder {
cmd_tx: Sender<Command>,
filters: Vec<TopicFilterBuf>,
}Expand description
Builder for unsubscribing from one or more topic filters.
Obtained via MqttClient::unsubscribe.
Call send to get an UnsubscribeFuture that can be
awaited for UNSUBACK, or converted to a QueuedUnsubscribeFuture via
UnsubscribeFuture::queued.
Fields§
§cmd_tx: Sender<Command>§filters: Vec<TopicFilterBuf>Implementations§
§impl UnsubscribeBuilder
impl UnsubscribeBuilder
pub(crate) fn new(cmd_tx: Sender<Command>, filter: TopicFilterBuf) -> Self
pub fn and(self, filter: TopicFilterBuf) -> Self
pub fn and(self, filter: TopicFilterBuf) -> Self
Adds an additional filter to this unsubscribe batch.
pub fn send(self) -> UnsubscribeFuture ⓘ
pub fn send(self) -> UnsubscribeFuture ⓘ
Returns an UnsubscribeFuture that drives the UNSUBSCRIBE to
completion.
No work is done until the future is first polled. Await the future to
wait for UNSUBACK, or call UnsubscribeFuture::queued to convert it
into a QueuedUnsubscribeFuture that resolves as soon as the
unsubscribe is recorded locally.
Auto Trait Implementations§
impl Freeze for UnsubscribeBuilder
impl RefUnwindSafe for UnsubscribeBuilder
impl Send for UnsubscribeBuilder
impl Sync for UnsubscribeBuilder
impl Unpin for UnsubscribeBuilder
impl UnwindSafe for UnsubscribeBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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