Cargo Features

tokio-modbus = { version = "0.11.0", default-features = false, features = ["rtu", "tcp", "rtu-sync", "tcp-sync", "rtu-server", "tcp-server", "rtu-over-tcp-server", "sync", "server"] }
default = rtu, tcp

These default features are set whenever tokio-modbus is added without default-features = false somewhere in the dependency tree.

rtu default rtu-over-tcp-server? rtu-server? rtu-sync?

Enables futures-core, smallvec and tokio-util, sink of futures-util

Affects client::rtu, prelude::rtu

tcp default tcp-server? tcp-sync?

Enables futures-core, tokio-util, sink of futures-util, net of tokio

Affects client::tcp, prelude::tcp

rtu-sync = rtu, sync

Enables tokio-serial

Disable default-features to exclude unused dependency on libudev

Affects sync::rtu

tcp-sync = sync, tcp

Affects sync::tcp

rtu-server = rtu, server

Enables tokio-serial, macros of tokio

Affects server::rtu

tcp-server rtu-over-tcp-server? = server, tcp

Enables macros and rt-multi-thread of tokio and all of socket2


Enable all API, even ones not available on all OSs.

Affects server::tcp

rtu-over-tcp-server = rtu, tcp-server

Affects server::rtu_over_tcp

sync rtu-sync? tcp-sync?

The following features are internal and must not be used in dependencies.

Enables futures-core, sink of futures-util, rt and time of tokio

Affects client::sync, prelude::sync

server rtu-server? tcp-server?

Affects frame::SlaveRequest, tokio-modbus::server

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

Please specify precise dependency versions in Cargo.toml:

futures-util rtu sync? tcp
socket2 tcp-server?