GithubHelp home page GithubHelp logo

Comments (5)

thosaa avatar thosaa commented on May 28, 2024

I think I have sorted out now. I am not able to test it, however.
I have checked the master branch out, made the changes and it builds.
When I try to reference to it from my own project it states:

error[E0433]: failed to resolve: could not find `Server` in `tcp`
  --> src/main.rs:22:14
   |
22 |         tcp::Server::new(socket_addr).serve(|| Ok(modbus::MbServer));
   |              ^^^^^^ could not find `Server` in `tcp`

This is the dependency in Cargo.toml:

tokio-modbus = { version = "0.3.5", default-features = false, features = ["tcp"] }

This is the path override just below:

[patch.crates-io]
tokio-modbus = { path = "../tokio-modbus" }

I would like to test before making a pull request. Any help is appreciated, thanks.

/Thomas

from tokio-modbus.

flosse avatar flosse commented on May 28, 2024

@thosaa thanks for reporting this bug and fixing it.

from tokio-modbus.

thosaa avatar thosaa commented on May 28, 2024

You're welcome. :-)

I cannot see what has changed since tag v0.3.5 to now, since I cannot run my code with the newest version:
I have now set my dep to:

tokio-modbus = { version = "0.3.5", default-features = false, features = ["tcp", "server"] }

and the same patch.crates-io as before.

I now get this error:

23 |         tcp::Server::new(socket_addr).serve(|| Ok(modbus::MbServer));
   |                                       ^^^^^ the trait `tokio_modbus::server::service::Service` is not implemented for `modbus::MbServer`

And this is the way I call it:

    let _server = thread::spawn(move || {
        tcp::Server::new(socket_addr).serve(|| Ok(modbus::MbServer));
    });

from tokio-modbus.

flosse avatar flosse commented on May 28, 2024

bug fixed with 8284940

from tokio-modbus.

flosse avatar flosse commented on May 28, 2024

@thosaa I'll have a look at your questions at the weekend.

from tokio-modbus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.