pub struct PubsubClientSubscription<T>where
T: DeserializeOwned,{ /* private fields */ }
Expand description
A subscription.
The subscription is unsubscribed on drop, and note that unsubscription (and
thus drop) time is unbounded. See
PubsubClientSubscription::send_unsubscribe
.
Implementations§
source§impl<T> PubsubClientSubscription<T>where
T: DeserializeOwned,
impl<T> PubsubClientSubscription<T>where
T: DeserializeOwned,
sourcepub fn send_unsubscribe(&self) -> Result<(), PubsubClientError>
pub fn send_unsubscribe(&self) -> Result<(), PubsubClientError>
Send an unsubscribe message to the server.
Note that this will block as long as the internal subscription receiver is waiting on messages from the server, and this can take an unbounded amount of time if the server does not send any messages.
If a pubsub client needs to shutdown reliably it should use
the async client in crate::nonblocking::pubsub_client
.
sourcepub fn shutdown(&mut self) -> Result<()>
pub fn shutdown(&mut self) -> Result<()>
Shutdown the internel message receiver and wait for its thread to exit.
Note that this will block as long as the subscription receiver is waiting on messages from the server, and this can take an unbounded amount of time if the server does not send any messages.
If a pubsub client needs to shutdown reliably it should use
the async client in crate::nonblocking::pubsub_client
.
Trait Implementations§
source§impl<T> Drop for PubsubClientSubscription<T>where
T: DeserializeOwned,
impl<T> Drop for PubsubClientSubscription<T>where
T: DeserializeOwned,
Auto Trait Implementations§
impl<T> Freeze for PubsubClientSubscription<T>
impl<T> !RefUnwindSafe for PubsubClientSubscription<T>
impl<T> Send for PubsubClientSubscription<T>where
T: Send,
impl<T> Sync for PubsubClientSubscription<T>where
T: Sync,
impl<T> Unpin for PubsubClientSubscription<T>where
T: Unpin,
impl<T> !UnwindSafe for PubsubClientSubscription<T>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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>
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>
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