pub async fn publish<T: Serialize>(&self, body: T) -> Result<()> {
        let data = serde_json::to_vec(&body).context(MessageSerializeError)?;

        let mut topic_guard = self.topic.lock().await;
        (*topic_guard)
            .publish(data)
            .await
            .context(MessagePublishError)?;

        Ok(())
    }
/// Publish a message to this topic.
Publish a message to this topic.
Publish a message to this topic .
pub async fn publish<T: Serialize>(&self, body: T) -> Result<()> {
        let data = serde_json::to_vec(&body).context(MessageSerializeError)?;
        let mut topic_guard = self.topic.lock().await;
        (*topic_guard)
            .publish(data)
            .await
            .context(MessagePublishError)?;
        Ok(())
    }
pub async fn publish < T : Serialize > ( & self , body : T ) -> Result < ( ) > { let data = serde_json :: to_vec ( & body ) . context ( MessageSerializeError ) ? ; let mut topic_guard = self . topic . lock ( ) . await ; ( * topic_guard ) . publish ( data ) . await . context ( MessagePublishError ) ? ; Ok ( ( ) ) }
Publish a message to this topic.
Publish a message to this topic .
&self
body
T