# SPDX-FileCopyrightText: Copyright (c) 2017-2024 slowtec GmbH # SPDX-License-Identifier: MIT OR Apache-2.0 [package] name = "tokio-modbus" description = "Tokio-based Modbus library" version = "0.15.0" authors = [ "slowtec GmbH ", "Markus Kohlhase ", ] license = "MIT OR Apache-2.0" readme = "README.md" keywords = ["fieldbus", "modbus", "hardware", "automation"] homepage = "https://github.com/slowtec/tokio-modbus" repository = "https://github.com/slowtec/tokio-modbus" edition = "2021" rust-version = "1.65" include = ["/src", "/CHANGELOG.md", "/README.md", "/LICENSES"] [package.metadata.docs.rs] all-features = true # Please specify precise dependency versions in Cargo.toml: # [dependencies] async-trait = "0.1.77" byteorder = "1.5.0" bytes = "1.5.0" futures-core = { version = "0.3.30", optional = true, default-features = false } futures-util = { version = "0.3.30", optional = true, default-features = false } log = "0.4.20" smallvec = { version = "1.13.1", optional = true, default-features = false } socket2 = { version = "0.5.5", optional = true, default-features = false } thiserror = "1.0.58" tokio = { version = "1.35.1", default-features = false, features = ["io-util"] } # Disable default-features to exclude unused dependency on libudev tokio-serial = { version = "5.4.4", optional = true, default-features = false } tokio-util = { version = "0.7.10", optional = true, default-features = false, features = [ "codec", ] } [dev-dependencies] anyhow = "1.0.86" env_logger = "0.11.5" futures = "0.3.30" tokio = { version = "1.35.1", default-features = false, features = [ "macros", "rt-multi-thread", "time", ] } tokio-serial = { version = "5.4.4", default-features = false } rustls-pemfile = "2.1.2" tokio-rustls = { version = "0.26.0", default-features = false } pkcs8 = { version = "0.10.2", features = ["encryption", "pem", "std"] } pem = "3.0.4" pki-types = { package = "rustls-pki-types", version = "1" } rustls = { version = "0.23.12", default-features = false, features = ["std"] } [features] default = ["rtu", "tcp"] rtu = [ "dep:futures-core", "futures-util/sink", "dep:smallvec", "dep:tokio-util", ] tcp = ["dep:futures-core", "futures-util/sink", "tokio/net", "dep:tokio-util"] rtu-sync = ["rtu", "sync", "dep:tokio-serial"] tcp-sync = ["tcp", "sync"] rtu-server = ["rtu", "server", "tokio/macros", "dep:tokio-serial"] tcp-server = [ "tcp", "server", "socket2/all", "tokio/macros", "tokio/rt-multi-thread", ] rtu-over-tcp-server = ["rtu", "tcp-server"] # The following features are internal and must not be used in dependencies. sync = ["dep:futures-core", "futures-util/sink", "tokio/time", "tokio/rt"] server = [] [badges] maintenance = { status = "actively-developed" } [[example]] name = "rtu-client-sync" path = "examples/rtu-client-sync.rs" required-features = ["rtu-sync"] [[example]] name = "rtu-client" path = "examples/rtu-client.rs" required-features = ["rtu"] [[example]] name = "rtu-server" path = "examples/rtu-server.rs" required-features = ["rtu-server"] [[example]] name = "rtu-server-address" path = "examples/rtu-server-address.rs" required-features = ["rtu-server"] [[example]] name = "tcp-client-custom-fn" path = "examples/tcp-client-custom-fn.rs" required-features = ["tcp"] [[example]] name = "tcp-client-sync" path = "examples/tcp-client-sync.rs" required-features = ["tcp-sync"] [[example]] name = "tcp-client" path = "examples/tcp-client.rs" required-features = ["tcp"] [[example]] name = "tcp-server" path = "examples/tcp-server.rs" required-features = ["tcp-server"] [[example]] name = "rtu-over-tcp-server" path = "examples/rtu-over-tcp-server.rs" required-features = ["rtu-over-tcp-server"] [[example]] name = "tls-client" path = "examples/tls-client.rs" required-features = ["tcp"] [[example]] name = "tls-server" path = "examples/tls-server.rs" required-features = ["tcp-server"]