FactbirdHQ / mqttrust

MQTT client for embedded devices, written in rust
50 stars 5 forks source link

Remove PublishPayload trait #32

Closed MathiasKoch closed 3 years ago

MathiasKoch commented 3 years ago

This PR removes the clunky odd PublishPayload trait, and cleans up quite a lot.

It also changes the Mqtt trait to be all by-reference, meaning that it is purely the implementor that sets limits on topic length, payload length etc.

The mqttrust_core implementation has been changed to allow configuring the max topic length and the max payload length as consts during initialization.

Adds an integration test that connects, subscribes and publishes to a real broker at hivemq.com

Fixes #31

codecov-commenter commented 3 years ago

Codecov Report

Merging #32 (dde9c78) into master (a6b9ce8) will increase coverage by 0.21%. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
+ Coverage   53.70%   53.91%   +0.21%     
==========================================
  Files           6        7       +1     
  Lines         581      588       +7     
  Branches      144      124      -20     
==========================================
+ Hits          312      317       +5     
- Misses        177      186       +9     
+ Partials       92       85       -7     
Impacted Files Coverage Δ
mqttrust/src/lib.rs 100.00% <ø> (ø)
mqttrust_core/src/lib.rs 27.77% <ø> (+0.75%) :arrow_up:
mqttrust/src/requests.rs 24.00% <20.00%> (-60.38%) :arrow_down:
mqttrust_core/src/eventloop.rs 39.89% <33.33%> (+1.17%) :arrow_up:
mqttrust_core/src/state.rs 51.67% <70.00%> (+3.28%) :arrow_up:
mqttrust_core/src/client.rs 79.31% <79.31%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a6b9ce8...dde9c78. Read the comment docs.