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