Perhaps discussion should be made as to whether or not it would make sense to expose the publish struct in some way. You would be able to dynamically create one dependant on what you are looking for.
for example:
///Defaults to non retained, QOS 1 and publish should return error on malformed message
let mut message = MqttMessage::new();
message.payload("This is a payload")
.topic("hello/world")
.retain();
mqtt_client.publish(message);
I'm not sure about creating a dynamic impl inside a struct... can you do something like mqtt_client::message::new();? That would make things even easier in that you could call .publish() after the .retain()
implement a boolean parameter for #120.
Perhaps discussion should be made as to whether or not it would make sense to expose the publish struct in some way. You would be able to dynamically create one dependant on what you are looking for.
for example:
I'm not sure about creating a dynamic impl inside a struct... can you do something like
mqtt_client::message::new();
? That would make things even easier in that you could call.publish()
after the.retain()