Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC: Add new Error type for the public API #231

Closed
wants to merge 10 commits into from
Closed

POC: Add new Error type for the public API #231

wants to merge 10 commits into from

Conversation

benjamin-nw
Copy link
Contributor

@benjamin-nw benjamin-nw commented Dec 19, 2023

This PR is a PoC to show an implementation with an Error and a Result type for the tokio-modbus crate.

The goal of the PoC is to test if updating the std::io::Error into a crate::error::Error can be an effective solution to better handle Exception returned by a modbus server.

Working examples:

  • rtu-client-sync.rs
  • rtu-client.rs
  • rtu-server-address.rs
  • rtu-server.rs
  • tcp-client-custom-fn.rs
  • tcp-client-sync.rs
  • tcp-client.rs
  • tcp-server.rs
  • tls-client.rs
  • tls-server.rs

Please, feel free to review this PR anytime.

…hide implementation details

`ExceptionResponse` will be added to the public API.
Its fields must now be `private` and not be accessible to users of the
library.
…`ExceptionResponse`

This propose a simple API to use `ExceptionResponse`.
The `Error` type is a specialization of the `Error` type for modbus
communication.
The `Result` type is a specialization of the `Result` type with the
modbus `Error` as error variant.
@benjamin-nw benjamin-nw changed the title Add new Error type for the public API POC: Add new Error type for the public API Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant