Trait bonsaidb::core::pubsub::Subscriber
source · pub trait Subscriber {
// Required methods
fn subscribe_to_bytes(&self, topic: Vec<u8>) -> 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§
sourcefn subscribe_to_bytes(&self, topic: Vec<u8>) -> Result<(), Error>
fn subscribe_to_bytes(&self, topic: Vec<u8>) -> Result<(), Error>
Subscribe to Message
s published to topic
.
Provided Methods§
Object Safety§
This trait is not object safe.