fn publish_to_broker(
        &self,
        message: BrokerMessage,
        exchange: &Exchange,
    ) -> Result<(), PvError> {
        // JSON, as widely used format, is exploited for serialisation to be agnostic
        // to the other parts of the system.
        // WARNING: serde_json does currently not support native bit precision floating point
        // serialisation. This is ignored here for the sake of simplicity.
        let serialised_message = serde_json::to_vec(&message)?;
        exchange.publish(Publish::new(&serialised_message, METER_ROUTING_KEY))?;
        Ok(())
    }
/// Publishes the specified message to the broker.
///
/// * `message` - the message to publish
/// * `exchange` - the exchange to use for publishing
Publishes the specified message to the broker.
`message` - the message to publish
`exchange` - the exchange to use for publishing
Publishes the specified message to the broker . ` message ` - the message to publish ` exchange ` - the exchange to use for publishing
fn publish_to_broker(
        &self,
        message: BrokerMessage,
        exchange: &Exchange,
    ) -> Result<(), PvError> {
        // JSON, as widely used format, is exploited for serialisation to be agnostic
        // to the other parts of the system.
        // WARNING: serde_json does currently not support native bit precision floating point
        // serialisation. This is ignored here for the sake of simplicity.
        let serialised_message = serde_json::to_vec(&message)?;
        exchange.publish(Publish::new(&serialised_message, METER_ROUTING_KEY))?;
        Ok(())
    }
fn publish_to_broker ( & self , message : BrokerMessage , exchange : & Exchange , ) -> Result < ( ) , PvError > { // JSON, as widely used format, is exploited for serialisation to be agnostic // to the other parts of the system. // WARNING: serde_json does currently not support native bit precision floating point // serialisation. This is ignored here for the sake of simplicity. let serialised_message = serde_json :: to_vec ( & message ) ? ; exchange . publish ( Publish :: new ( & serialised_message , METER_ROUTING_KEY ) ) ? ; Ok ( ( ) ) }
Publishes the specified message to the broker.
Publishes the specified message to the broker .
&self
message
BrokerMessage
exchange
&Exchange
&self
message
BrokerMessage
exchange
&Exchange