pub trait Subscriber {
    // Required methods
    fn subscribe_to_bytes(&self, topic: Vec<u8, Global>) -> Result<(), Error>;
    fn unsubscribe_from_bytes(&self, topic: &[u8]) -> Result<(), Error>;
    fn receiver(&self) -> &Receiver ;

    // Provided methods
    fn subscribe_to<Topic>(&self, topic: &Topic) -> Result<(), Error>
       where Topic: Serialize { ... }
    fn unsubscribe_from<Topic>(&self, topic: &Topic) -> Result<(), Error>
       where Topic: Serialize { ... }
}
Expand description

A subscriber to one or more topics.

Required Methods§

fn subscribe_to_bytes(&self, topic: Vec<u8, Global>) -> Result<(), Error>

Subscribe to Messages published to topic.

fn unsubscribe_from_bytes(&self, topic: &[u8]) -> Result<(), Error>

Unsubscribe from Messages published to topic.

fn receiver(&self) -> &Receiver

Returns the receiver to receive Messages.

Provided Methods§

fn subscribe_to<Topic>(&self, topic: &Topic) -> Result<(), Error>where Topic: Serialize,

Subscribe to Messages published to topic.

fn unsubscribe_from<Topic>(&self, topic: &Topic) -> Result<(), Error>where Topic: Serialize,

Unsubscribe from Messages published to topic.

Implementors§