//! The [`Subscriber`] trait: a stream of broker deliveries.
use Error as StdError;
use Stream;
use crateIncomingMessage;
/// A consumer attached to one or more broker names.
///
/// `Subscriber` yields messages via a [`Stream`], so users get back-pressure and integration with
/// the rest of the futures ecosystem for free. Each yielded item is a broker-specific
/// [`IncomingMessage`] that must be acknowledged.
///
/// # Cancel safety
///
/// Polling [`stream`] is cancel-safe: dropping the returned `Stream` between polls is allowed.
/// Implementations must not buffer partially-decoded frames in `&self` state; if buffering is
/// required, it belongs in `&mut self`.
///
/// [`stream`]: Self::stream