[][src]Struct bitcoin_zmq::ZMQSubscriber

pub struct ZMQSubscriber(_);

Factory object allowing constuction of single stream channels and broadcast channels.

Cloning to receive additional factories does not increase overhead when compared to using the subscribe method.

Methods

impl ZMQSubscriber[src]

pub fn new(
    addr: &str,
    capacity: usize
) -> (Self, impl Future<Item = (), Error = SubscriptionError> + Send)
[src]

Constructs a new factory paired with a future representing the connection/broker.

pub fn single_stream(
    addr: &str,
    topic: Topic,
    capacity: usize
) -> (Box<dyn Stream<Item = Vec<u8>, Error = ()> + Send>, impl Future<Item = (), Error = SubscriptionError> + Send)
[src]

Construct a single stream filtered by topic.

The stream is paired with a future representing the connection.

pub fn subscribe(
    &self,
    filter_topic: Topic
) -> impl Stream<Item = Bytes, Error = ()> + Send + Sized
[src]

Subscribe to one-of-many streams filtered by topic.

The stream is paired with a future representing the connection and the broker coordinating the broadcast channel.

The return type is Bytes which prevents unecessary clones while streams are being handled by the broker.

This does not consume the factory.

Trait Implementations

impl Clone for ZMQSubscriber[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]