Consider simpler ways of constructing Pub messages for the user. It may make sense to allow the user to build a message locally that they provide to the publish() and reply() APIs directly, such as
// Construct a fresh message for publication.
let message = Publish(payload).topic("data/topic").qos(QoS::ExactlyOnce).properties(properties).finish().unwrap();
// Build a reply to a received packet.
let message = Publish(payload).reply(received_properties).finish().unwrap();
mqtt.client.publish(message);
Consider simpler ways of constructing
Pub
messages for the user. It may make sense to allow the user to build a message locally that they provide to thepublish()
andreply()
APIs directly, such as