pub async fn publish(
        &mut self,
        topic: &str,
        qos: Qos,
        data: &Vec<u8>,
    ) -> Result<&Self, GcpIoTError> {
        //let full_topic = self.topic_prefix.to_owned() + format!("events/{}", topic);
        let full_topic = format!("{}events/{}", self.topic_prefix, topic);
        self.client.publish(&full_topic, qos, data).await?;
        Ok(self)
    }
/// Publish message to given topic
///
/// Publishes message with the topic and QoS-class. Google cloud only support Qos-classes 0 and 1 for now.
/// The method aggregates the prefix '/devices/*device_id*/ and the caller only need to supply the topic (without '/') and data.
///
/// Example
///
/// TODO Create example
///
Publish message to given topic
Publishes message with the topic and QoS-class. Google cloud only support Qos-classes 0 and 1 for now.
The method aggregates the prefix '/devicesdevice_id*/ and the caller only need to supply the topic (without '/') and data.

Example


Publish message to given topic Publishes message with the topic and QoS - class . Google cloud only support Qos - classes 0 and 1 for now . The method aggregates the prefix ' / devicesdevice_id * / and the caller only need to supply the topic ( without ' / ' ) and data . Example
pub async fn publish(
        &mut self,
        topic: &str,
        qos: Qos,
        data: &Vec<u8>,
    ) -> Result<&Self, GcpIoTError> {
        //let full_topic = self.topic_prefix.to_owned() + format!("events/{}", topic);
        let full_topic = format!("{}events/{}", self.topic_prefix, topic);
        self.client.publish(&full_topic, qos, data).await?;
        Ok(self)
    }
pub async fn publish ( & mut self , topic : & str , qos : Qos , data : & Vec < u8 > , ) -> Result < & Self , GcpIoTError > { //let full_topic = self.topic_prefix.to_owned() + format!("events/{}", topic); let full_topic = format ! ( " " self topic_prefix topic ) ; self . client . publish ( & full_topic , qos , data ) . await ? ; Ok ( self ) }
Publish message to given topic
Publishes message with the topic and QoS-class.
Publish message to given topic Publishes message with the topic and QoS - class .
&mut self
topic
&str
qos
Qos
data
&Vec<u8>
&mut self
topic
&str
qos
Qos
data
&Vec<u8>