astarte-platform / astarte-device-sdk-rust

Apache License 2.0
6 stars 12 forks source link

feat(disconnect): move disconnect to the client #366

Closed joshuachp closed 2 months ago

joshuachp commented 3 months ago

Implement the DisconnectClient trait on the DeviceClient, because after the handle_events takes ownership of the connection. The client needs to send the disconnect over the connection and then the connection will handle it and both tasks will exit.

Depends on #363

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 57.14286% with 18 lines in your changes missing coverage. Please review.

Project coverage is 69.3%. Comparing base (527a835) to head (5d985c5). Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/connection.rs 75.0% 8 Missing :warning:
src/transport/mqtt/mod.rs 0.0% 7 Missing :warning:
src/client.rs 0.0% 3 Missing :warning:
Additional details and impacted files | [Files with missing lines](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/366?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform) | Coverage Δ | | |---|---|---| | [src/transport/mqtt/error.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/366?src=pr&el=tree&filepath=src%2Ftransport%2Fmqtt%2Ferror.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL3RyYW5zcG9ydC9tcXR0L2Vycm9yLnJz) | `100.0% <ø> (ø)` | | | [src/client.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/366?src=pr&el=tree&filepath=src%2Fclient.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL2NsaWVudC5ycw==) | `64.7% <0.0%> (-1.4%)` | :arrow_down: | | [src/transport/mqtt/mod.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/366?src=pr&el=tree&filepath=src%2Ftransport%2Fmqtt%2Fmod.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL3RyYW5zcG9ydC9tcXR0L21vZC5ycw==) | `63.1% <0.0%> (-1.6%)` | :arrow_down: | | [src/connection.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/366?src=pr&el=tree&filepath=src%2Fconnection.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL2Nvbm5lY3Rpb24ucnM=) | `52.0% <75.0%> (+1.9%)` | :arrow_up: |