pub struct Subscription { /* private fields */ }
Expand description

A subscription to a subject.

Implementations

Gets the next message, or returns None if the subscription has been unsubscribed or the connection is closed.

Try to get the next message, or None if no messages are present or if the subscription has been unsubscribed or the connection closed.

Example
if let Some(msg) = sub.try_next() {
  println!("Received {}", msg);
}

Stops listening for new messages, but the remaining queued messages can still be received.

Stops listening for new messages and discards the remaining queued messages.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.