-
Notifications
You must be signed in to change notification settings - Fork 127
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
Tokio module 'runtime' is private #191
Comments
This appears to be caused by this https://github.com/tokio-rs/tokio/blame/master/tokio/src/lib.rs#L536-L541 |
... so it's not related to |
This is related to |
hm... I tried to compile some examples and could not reproduce this error. Could you provide some more info to reproduce it? |
[package]
name = "test"
version = "0.0.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio-modbus = { version = "0.8.0", default-features = false, features = ["rtu-sync"] }
tokio-serial = "5.4.4"
// SPDX-FileCopyrightText: Copyright (c) 2017-2023 slowtec GmbH <[email protected]>
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Synchronous RTU client example
fn main() -> Result<(), Box<dyn std::error::Error>> {
use tokio_modbus::prelude::*;
let tty_path = "/dev/ttyUSB0";
let slave = Slave(0x17);
let builder = tokio_serial::new(tty_path, 19200);
let mut ctx = sync::rtu::connect_slave(&builder, slave)?;
println!("Reading a sensor value");
let rsp = ctx.read_holding_registers(0x082B, 2)?;
println!("Sensor value is: {rsp:?}");
Ok(())
} |
It appears to be because of |
I'm so sorry, I'm still not able to produce the error, even if I disable the default features 🤔 cargo check --no-default-features --features rtu-sync --example rtu-client-sync |
Yes that command works if I clone tokio-modbus and run it within, this only happens in a new project with tokio-modbus as a dependency |
Here's my test project if you like, it's just the above two files Test.zip |
I see...you're right! |
Could you check if #192 solves the problem? |
That does fix it 👍 |
The text was updated successfully, but these errors were encountered: