Cargo Features

[dependencies]
async-nats = { version = "0.47.0", default-features = false, features = ["jetstream", "kv", "object-store", "service", "crypto", "websockets", "aws-lc-rs", "ring", "fips", "nkeys", "nuid", "experimental", "server_2_10", "server_2_11", "server_2_12", "slow_tests", "compatibility_tests"] }
default = crypto, jetstream, kv, nkeys, nuid, object-store, ring, server_2_10, server_2_11, server_2_12, service, websockets

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

jetstream default kv object-store

Enables Service API for the client.

Enables base64, serde_nanos, time, and tryhard

Affects async-nats::jetstream

kv default = jetstream

Affects context::KeyValueErrorKind, context::KeyValueError, context::UpdateKeyValueErrorKind, context::CreateKeyValueError, context::UpdateKeyValueError, jetstream::kv, context::CreateKeyValueErrorKind

object-store default = crypto, jetstream

Affects context::CreateObjectStoreError, context::CreateObjectStoreErrorKind, context::ObjectStoreErrorKind, context::ObjectStoreError, context::DeleteObjectStore, context::DeleteObjectStoreKind, jetstream::object_store, context::CreateKeyValueErrorKind

service default

Enables serde_nanos and time

Affects async-nats::service

crypto default object-store
websockets default

Enables tokio-websockets ^0.10

aws-lc-rs fips?

Enables aws-lc-rs and aws-lc-rs of rustls-webpki, tokio-rustls, and optional tokio-websockets ^0.10

tokio-rustls:

Alias because Cargo features commonly use -

ring default

Enables ring, ring of tokio-rustls and optional tokio-websockets ^0.10

fips = aws-lc-rs

Enables fips of tokio-rustls

nkeys default

Enables base64 and nkeys

nuid default

Use NUID for generating unique IDs (inbox subjects, object store nonces).
When disabled, falls back to rand-based alphanumeric ID generation.

Enables nuid ^0.5

experimental

All experimental features are part of this feature flag.

server_2_10 default

Features that require nats-server version 2.10 or higher.
It is enabled by default since given official nats-server release.

Affects consumer::Config.filter_subjects, consumer::Config.metadata, pull::OrderedConfig.filter_subjects, pull::OrderedConfig.metadata, pull::Config.filter_subjects, pull::Config.metadata, push::Config.filter_subjects, push::Config.metadata, push::OrderedConfig.filter_subjects, push::OrderedConfig.metadata, kv::Config.compression, stream::Config.metadata, stream::Config.subject_transform, stream::Config.compression, stream::Config.consumer_limits, stream::Config.first_sequence, stream::Source.subject_transforms

server_2_11 default

Affects account::Requests.level, account::Requests.inflight, consumer::Info.paused, consumer::Info.pause_remaining, consumer::Config.priority_policy, consumer::Config.priority_groups, consumer::Config.pause_until, consumer::PriorityPolicy, pull::Config.priority_policy, pull::Config.priority_groups, pull::Config.pause_until, push::Config.pause_until, kv::Config.limit_markers, stream::Config.pause_until, stream::Config.allow_message_ttl, stream::Config.subject_delete_marker_ttl, stream::PauseResponse

server_2_12 default

Affects pull::BatchConfig.priority, stream::Config.allow_atomic_publish, stream::Config.allow_message_schedules, stream::Config.allow_message_counter, stream::ClusterInfo.system_account, stream::ClusterInfo.traffic_account

slow_tests

Used for enabling/disabling tests that by design take a lot of time to complete.
Those tests are usually used for time-sensitive checks, like consumer heartbeats, longer timeouts, etc.

compatibility_tests

Used for tests that ensure compatibility across client libraries in APIs that are abstraction layer build on top of NATS server features (Service API, KV, Object Store etc.)