pub struct Publisher { /* private fields */ }Implementations§
Source§impl Publisher
impl Publisher
pub fn new(client: Client, worker_id: String) -> Self
Sourcepub async fn publish<T: Message>(&self, message: T) -> Result<(), WorkerError>
pub async fn publish<T: Message>(&self, message: T) -> Result<(), WorkerError>
Publishes a protobuf message to a worker-specific topic
Sourcepub async fn publish_raw(&self, data: Bytes) -> Result<(), WorkerError>
pub async fn publish_raw(&self, data: Bytes) -> Result<(), WorkerError>
Publishes raw bytes to a worker-specific topic
Sourcepub async fn publish_to<T: Message>(
&self,
topic: String,
message: T,
) -> Result<(), WorkerError>
pub async fn publish_to<T: Message>( &self, topic: String, message: T, ) -> Result<(), WorkerError>
Publishes a protobuf message to a custom topic
Auto Trait Implementations§
impl Freeze for Publisher
impl !RefUnwindSafe for Publisher
impl Send for Publisher
impl Sync for Publisher
impl Unpin for Publisher
impl !UnwindSafe for Publisher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more