# Cargo feature graph

> Every cargo feature on the tako-rs umbrella crate — transports, runtimes, plugins, extractors, observability, and runtime selection.

The umbrella crate `tako-rs` is the public entry point. Sub-crate
features are reached through it — for example, `tako-rs/multipart`
turns on `tako-rs-extractors/multipart` and `tako-rs-core/multipart`
together. You should never need to depend on `tako-rs-core`,
`tako-rs-extractors`, `tako-rs-server`, `tako-rs-server-pt`, `tako-rs-streams`,
or `tako-rs-plugins` directly.

To inspect the current shape locally:

```bash
cargo metadata --format-version 1 --no-deps \
  | jq '.packages[] | select(.name == "tako-rs") | .features'
```

## Transports

| Feature             | Description                                                                                                              | Gates                                                                                               |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
| *(default)*         | HTTP/1.1, raw TCP, Unix sockets, static files, core extractors and middleware. No optional flags are enabled.            | always on                                                                                           |
| `ws`                | WebSocket upgrades over HTTP/1.1 on either runtime; GraphQL subscriptions also require `async-graphql` and run on Tokio. | `tako-rs-core/ws`                                                                                   |
| `sse`               | Server-Sent Events on either runtime.                                                                                    | `tako-rs-streams/sse`                                                                               |
| `file-stream`       | `FileStream` responder and range helpers; static file serving is available without this flag.                            | `tako-rs-streams/file-stream`, `tako-rs-core/file-stream`                                           |
| `proxy-protocol`    | Trusted PROXY v1/v2 listener on either runtime.                                                                          | `tako-rs-server/proxy-protocol`                                                                     |
| `udp`               | Raw UDP datagrams on either runtime.                                                                                     | `tako-rs-server/udp`                                                                                |
| `socket-activation` | Inherit listener descriptors through `ListenFds`.                                                                        | `tako-rs-server/socket-activation`                                                                  |
| `tls`               | Server-side HTTPS via `rustls`.                                                                                          | `tako-rs-server/tls`, `tako-rs-core/tls`                                                            |
| `http2`             | HTTP/2 cleartext (h2c) and ALPN-negotiated h2 over TLS.                                                                  | `tako-rs-server/http2`, `tako-rs-core/http2`                                                        |
| `http3`             | HTTP/3 over QUIC; also enables the QUIC dependency tree in `tako-rs-streams`.                                            | `tako-rs-server/http3`, `tako-rs-streams/http3`, `tako-rs-core/http3`                               |
| `webtransport`      | W3C WebTransport sessions on the HTTP/3 server, on either runtime, plus the Tokio-only raw QUIC helper. Implies `http3`. | `http3`, `tako-rs-server/webtransport`, `tako-rs-streams/webtransport`, `tako-rs-core/webtransport` |
| `vsock`             | Linux vsock listener for sidecar workloads.                                                                              | `tako-rs-server/vsock`                                                                              |

## Runtime selection

| Feature             | Description                                                                                                                  | Gates                                                                                                                           |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `compio`            | Switch the server to the `compio` runtime (io\_uring / IOCP / kqueue). Mutually exclusive with the tokio path at build time. | `tako-rs-core/compio`, `tako-rs-server/compio`, `tako-rs-streams/compio`, `tako-rs-plugins/compio`, `tako-rs-server-pt?/compio` |
| `compio-tls`        | TLS on compio. Implies `compio`.                                                                                             | `compio`, `tako-rs-server/compio-tls`, `tako-rs-core/compio-tls`                                                                |
| `per-thread`        | Thread-per-core HTTP/1; Tokio by default, Compio when `compio` is selected.                                                  | `dep:tako-rs-server-pt`                                                                                                         |
| `per-thread-compio` | Thread-per-core on Compio. Implies `per-thread` and `compio` throughout the workspace.                                       | `per-thread`, `compio`, `tako-rs-server-pt/compio`                                                                              |

See [Runtime compatibility](/docs/concepts/runtimes) for the tokio vs compio
trade-offs.

## Plugins, middleware, signals

| Feature          | Description                                                                     | Gates                                                                                                     |
| ---------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `plugins`        | Bundled middleware and plugins (CORS, compression, rate limiting, idempotency). | `tako-rs-core/plugins`, `tako-rs-plugins/plugins`, `tako-rs-server/plugins`, `tako-rs-server-pt?/plugins` |
| `signals`        | In-process pub/sub bus, queue lifecycle signals, transport signals.             | `tako-rs-core/signals`, `tako-rs-server/signals`, `tako-rs-plugins/signals`, `tako-rs-server-pt?/signals` |
| `ip-filter`      | `IpFilter` middleware.                                                          | `tako-rs-plugins/ip-filter`                                                                               |
| `hmac-signature` | `HmacSignature` middleware.                                                     | `tako-rs-plugins/hmac-signature`                                                                          |
| `json-schema`    | `JsonSchema` request-validation middleware.                                     | `tako-rs-plugins/json-schema`                                                                             |
| `zstd`           | Zstandard compression in `plugins::compression`. Implies `plugins`.             | `tako-rs-plugins/zstd`, `tako-rs-core/zstd`, `plugins`                                                    |

## Extractors

| Feature                | Description                                                                             | Gates                                                                          |
| ---------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `multipart`            | `Multipart` / `TakoTypedMultipart` body extractors.                                     | `tako-rs-extractors/multipart`, `tako-rs-core/multipart`                       |
| `protobuf`             | `Protobuf<T>` extractor via `prost`.                                                    | `tako-rs-extractors/protobuf`, `tako-rs-core/protobuf`                         |
| `simd`                 | Umbrella that enables both `simd-sonic` and `simd-json-impl`.                           | `simd-sonic`, `simd-json-impl`                                                 |
| `simd-sonic`           | `sonic-rs`-backed JSON path.                                                            | `tako-rs-extractors/simd-sonic`, `tako-rs-core/simd-sonic`                     |
| `simd-json-impl`       | `simd-json`-backed JSON path.                                                           | `tako-rs-extractors/simd-json-impl`, `tako-rs-core/simd-json-impl`             |
| `typed-header`         | `TypedHeader<H>` extractor (via `headers`).                                             | `tako-rs-extractors/typed-header`                                              |
| `zero-copy-extractors` | Borrowed variants of `Json`, `Form`, `Query`, `HeaderMap`.                              | `tako-rs-extractors/zero-copy-extractors`, `tako-rs-core/zero-copy-extractors` |
| `validator`            | `Validated<T>` adapter for the [`validator`](https://crates.io/crates/validator) crate. | `tako-rs-extractors/validator`                                                 |
| `garde`                | `Validated<T>` adapter for the [`garde`](https://crates.io/crates/garde) crate.         | `tako-rs-extractors/garde`                                                     |
| `jwt-simple`           | JWT decode / verify backed by [`jwt-simple`](https://crates.io/crates/jwt-simple).      | `tako-rs-plugins/jwt-simple`, `tako-rs-core/jwt-simple`                        |
| `ahash`                | Swap the default request hasher for `ahash` across the workspace.                       | `tako-rs-core/ahash`, `tako-rs-extractors/ahash`, `tako-rs-plugins/ahash`      |

## Docs, GraphQL, gRPC, OpenAPI

| Feature         | Description                                                            | Gates                                |
| --------------- | ---------------------------------------------------------------------- | ------------------------------------ |
| `async-graphql` | GraphQL HTTP handlers; WebSocket subscriptions additionally need `ws`. | `tako-rs-core/async-graphql`         |
| `graphiql`      | GraphiQL IDE endpoint.                                                 | `tako-rs-core/graphiql`              |
| `grpc`          | gRPC unary and streaming RPCs via prost.                               | `tako-rs-core/grpc`                  |
| `utoipa`        | OpenAPI docs via [`utoipa`](https://crates.io/crates/utoipa).          | `tako-rs-core/utoipa`                |
| `utoipa-yaml`   | YAML output for the `utoipa` integration. Implies `utoipa`.            | `utoipa`, `tako-rs-core/utoipa-yaml` |
| `vespera`       | OpenAPI docs via [`vespera`](https://crates.io/crates/vespera).        | `tako-rs-core/vespera`               |

## Observability backends

| Feature                 | Description                                                              | Gates                                                                                               |
| ----------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
| `tako-tracing`          | `tracing-subscriber` integration helpers.                                | `tako-rs-core/tako-tracing`, `tako-rs-server/tako-tracing`                                          |
| `metrics-prometheus`    | Prometheus scrape endpoint + histogram. Implies `plugins` and `signals`. | `tako-rs-plugins/metrics-prometheus`, `tako-rs-core/metrics-prometheus`, `plugins`, `signals`       |
| `metrics-opentelemetry` | OpenTelemetry OTLP metrics export. Implies `plugins` and `signals`.      | `tako-rs-plugins/metrics-opentelemetry`, `tako-rs-core/metrics-opentelemetry`, `plugins`, `signals` |

## Queue

`queue-cron` enables cron schedules and their chrono-based time calculations in `tako-rs-core`.

## Allocator

| Feature    | Description                                                                       | Gates                   |
| ---------- | --------------------------------------------------------------------------------- | ----------------------- |
| `jemalloc` | Re-export `tikv-jemallocator`; the application installs its own global allocator. | `dep:tikv-jemallocator` |

## Runtime and protocol combinations

`--all-features` compiles and selects Compio for the HTTP server, middleware,
signals, queues, and per-thread workers. The Tokio-only raw QUIC helper is absent
in that build. h2c is available through `http2`, WebTransport through
`webtransport`,
HTTP/3 through `http3`, PROXY protocol through `proxy-protocol`, Unix sockets on
every unix target, and TLS with ALPN HTTP/2 through `compio-tls` plus `http2`.

Tako enables Hyper's HTTP/2 support only through `http2` (other dependencies may
also enable it). The workspace selects the Tokio runtime, I/O, timer, signal,
filesystem, and synchronization features it uses instead of `full`.

The workspace MSRV is Rust 1.95. See the [2.1 migration guide](/docs/reference/migration-2-1)
for feature changes and explicit allocator configuration.

## Removed features

`client` and `native-certs` were removed in 2.3.0, together with
`tako::client`. Use [reqwest](https://crates.io/crates/reqwest) or
[ureq](https://crates.io/crates/ureq) for outbound HTTP.

Source: https://tako.rust-dd.com/docs/reference/features