Cargo Features

[dependencies]
tokio-listener = { version = "0.4.3", default-features = false, features = ["user_facing_default", "serde", "hyper014", "axum07", "inetd", "unix", "unix_path_tools", "sd_listen", "socket_options", "tonic010", "tonic011", "tonic012", "tokio-util", "multi-listener", "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, futures-util, hyper-util, hyper, tower ^0.4, and tower-service

Affects tokio-listener::axum07

inetd user_facing_default

Enable inetd (stdin/stdout) mode

Enables futures-util

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

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

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