Struct async_nats::Subscription [−][src]
pub struct Subscription { /* fields omitted */ }
A subscription to a subject.
Implementations
impl Subscription
[src]
impl Subscription
[src]pub async fn next(&self) -> Option<Message>
[src]
Gets the next message, or returns None
if the subscription
has been unsubscribed or the connection is closed.
pub async fn drain(&self) -> Result<()>
[src]
Stops listening for new messages, but the remaining queued messages can still be received.
pub async fn unsubscribe(&self) -> Result<()>
[src]
Stops listening for new messages and discards the remaining queued messages.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Subscription
impl !RefUnwindSafe for Subscription
impl Send for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl Unpin for Subscription
impl !UnwindSafe for Subscription
impl !UnwindSafe for Subscription