Cargo Features

[dependencies]
tokio-listener = { version = "0.5.0", default-features = false, features = ["user_facing_default", "serde", "hyper014", "axum07", "axum08", "inetd", "unix", "unix_path_tools", "sd_listen", "socket_options", "tonic010", "tonic011", "tonic012", "tokio-util", "multi-listener", "duplex_variant", "dummy_variant", "boxed_variant", "mpsc_listener", "custom_socket_address", "vsock", "clap"] }
default = tokio-util, user_facing_default

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

user_facing_default default = inetd, sd_listen, socket_options, unix, unix_path_tools

Subset of default features that add features supposed to be accessed by end user

serde = serde_with

Enable serde::Serialize and serde::Deserialize implementations for UserOptions and ListenerAddress and some other types.

Enables serde

hyper014

Enable hyper(v0.14)::server::accept::Accept implementation for Listener

Enables hyper ^0.14.27

axum07

Enable tokio-listener-adapted serve function from Axum 0.7 (and related types)

Enables axum ^0.7, futures-util, hyper-util, hyper, tower ^0.4, and tower-service

Affects tokio-listener::axum07

axum08

Enable axum::Listener implementation for Axum 0.8

Enables axum

inetd user_facing_default

Enable inetd (stdin/stdout) mode

Enables futures-util, io-std of tokio

unix user_facing_default

Enable UNIX socket mode

unix_path_tools user_facing_default = nix

Enable tools such as unlink/chmod/chown for UNIX path sockets in UserOptions

Affects options::UserOptions.unix_listen_unlink, options::UserOptions.unix_listen_chmod, options::UserOptions.unix_listen_uid, options::UserOptions.unix_listen_gid, unix_chmod::UnixChmodVariant

sd_listen user_facing_default = socket2

Enable receiving pre-bound sockets from inherited file descriptor (e.g. from systemd). Disabling this should make the crate unsafe-free.

Affects options::UserOptions.sd_accept_ignore_environment

socket_options user_facing_default = socket2

Enable socket options such as receive or send buffer sizes or keepalives in UserOptions

Affects options::UserOptions.tcp_keepalive, options::UserOptions.tcp_reuse_port, options::UserOptions.recv_buffer_size, options::UserOptions.send_buffer_size, options::UserOptions.tcp_only_v6, options::UserOptions.tcp_listen_backlog, tcp_keepalive_params::TcpKeepaliveParams

tonic010

Enable tonic(v0.10)::transport::server::Connected implementation for Connection

Enables tonic ^0.10.2

tonic011

Enable tonic(v0.11)::transport::server::Connected implementation for Connection

Enables tonic ^0.11.0

tonic012

Enable tonic(v0.12)::transport::server::Connected implementation for Connection

Enables tonic, tonic012 of optional tokio-vsock

tokio-util default

Enable tokio_util::net::Listener implementation for Listener.

Enables tokio-util

multi-listener

Enable Listener::bind_multiple and sd-listen:* (if combined with sd_listen feature)

Enables futures-util

duplex_variant

Add tokio::io::DuplexStream variant to Connection for extra flexibility (cannot be triggered by end user, only by API).

Enables io-util of tokio

dummy_variant

Add tokio::io::Empty variant to Connection for extra flexibility (cannot be triggered by end user, only by API).

Enables io-util of tokio

boxed_variant

Add Pin<Box<dyn AsyncRead + AsyncWrite + Send>> variant to Connection for extra flexibility (cannot be triggered by end user, only by API). In particular this allows using tokio_test::io::Mock as a Connection. Also allows constructing customized Listeners.

Enables io-util of tokio

mpsc_listener

Add ability to use tokio::sync::mpsc::Receiver as a custom Listener. Can be useful for tests, together with boxed_variant.

Enables tokio

custom_socket_address

Add additional variant to SomeSocketAddress for storing arbitrary content.

vsock

Enable Vsock support on Linux and Mac

Enables tokio-vsock

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.

clap implicit feature

Enables clap

Enable derive(Parser) for UserOptions and other Clap helpers

serde_with serde?
socket2 sd_listen? socket_options?
nix unix unix_path_tools?

Enables nix ^0.26.2