•
12 min read
Note #7: Rust Crates for Everyday Use
On this page

A good starting point when searching for Rust crates is blessed.rs It serves as an unofficial guide to the Rust ecosystem. Here is another set of crates that can help out anyone writing any decent sized Rust project.

I put this list together while going through Rust infrastructure projects and I am keeping it mainly as a personal reference when I have to go crate hunting.

Application and Configuration Dependencies

DependencyWhat it does / where it is used
cfg-ifConditional compilation helpers, used where platform or feature-specific code needs a single source-level branch.
clapParses the CLI arguments, subcommands, environment-backed options, and help text.
clap_completeGenerates shell completion scripts.
indocKeeps multiline help text, templates, and test data readable without unwanted indentation.
exitcodeStandardized process exit-code constants for CLI failures.
coloredTerminal color output for CLI diagnostics and user-facing output.
semverParses and compares component, protocol, or API versions.
uuidGenerates and serializes IDs, with v4 and v7 support enabled.
dirs-nextOptional OS-specific configuration/cache/home-directory discovery, used by Docker-related behavior.
notifyWatches files, primarily to reload configuration and related local state.
globExpands file patterns, used in configuration and file-oriented behavior.
hostnameObtains the local host name for event metadata and host-oriented configuration.
bytesizeParses and formats human-friendly byte quantities such as buffer limits.
humantimeWorkspace-shared duration parsing/formatting support.
chronoTimestamps and date/time conversions.
chrono-tzIANA time-zone support for config parsing and time operations.
urlParses and validates endpoint URLs in component configuration.
percent-encodingURL/query escaping and decoding.
encoding_rsCharacter-set conversion for codecs and configuration.
tomlTOML configuration parsing.
serde_yamlYAML configuration parsing.
serde_jsonJSON configuration, event payloads, schemas, HTTP payloads, and arbitrary JSON values. preserve_order is enabled, so map ordering survives where relevant.
serdeThe base serialization framework used throughout component configs and events.
serde_withMore expressive serde adapters for common config representations.
serde_path_to_errorReports the exact nested config path when deserialization fails.
http-serdeserde support for HTTP types.
typetagSerializes/deserializes trait-object-like configuration types.
dyn-cloneMakes boxed trait objects clonable.
derivativeGenerates customized Debug, Clone, and similar implementations.
derive_moreGenerates small conversion and display implementations.
strumDerives enum iteration, parsing, display, and related helpers.
inventoryLink-time registration of component definitions. This is one of the mechanisms that lets Vector discover component implementations without a central manually maintained list.
enum_dispatchGenerates dispatch from enums to trait implementations without dynamic dispatch in selected paths.
arr_macroBuilds fixed-size arrays in places where ordinary array initialization is awkward.
const-strWorkspace-shared compile-time string manipulation.
convert_caseWorkspace-shared string case conversion, mainly useful to procedural macros and generated docs/schema naming.
pasteyWorkspace-shared identifier concatenation for macro-generated code.

Async runtime, streams, and flow-control

DependencyWhat it does / where it is used
tokioThe async runtime. Enable full for production code and uses tasks, channels, timers, networking, signals, process support, and synchronization.
futuresCore async traits and combinators.
futures-utilStream, future, sink, and async utility extensions.
async-streamBuilds async Streams with generator-like syntax.
async-traitLets traits expose async methods before native async trait ergonomics cover all needed patterns.
tokio-streamTurns Tokio channels, listeners, timers, and watches into streams.
tokio-utilTokio codecs, I/O helpers, network helpers, cancellation/time support, and DelayQueue style utilities.
stream-cancelMakes streams cancellable when topology shutdown begins.
pin-projectSafe pin-projection for custom streams, futures, and sinks.
towerComposable service middleware. Uses buffering, limits, retries, timeouts, balancing, discovery, and utility middleware. Its batch/driver machinery uses tower::Service
tower-httpHTTP-specific Tower middleware for tracing plus request/response compression and decompression.
tracing-towerConnects Tower requests to tracing spans.
console-subscriberOptional Tokio-console instrumentation, enabled by the tokio-console feature.
crossbeam-utilsWorkspace-shared concurrency utilities used by member crates.
dashmapWorkspace-shared concurrent map implementation for member crates.
arc-swapAtomic replacement of shared immutable state. Used by the optional EC2 metadata transform, where readers need cheap consistent snapshots.
evmap, evmap-deriveOptional eventually-consistent read-optimized maps for in-memory enrichment tables.
thread_localOptional thread-local state used by the in-memory enrichment implementation.
lruBounded least-recently-used cache.
governorOptional rate limiting, used by throttle and Windows Event Log ingestion.
cuckoo-clockOptional expiration/clock structure for memory enrichment tables.
bloomyOptional Bloom-filter-style membership support for enrichment and tag-cardinality control.
hashbrownOptional high-performance hash map, used by tag-cardinality limiting.
hash_hasher, seahashFast hashing in performance-sensitive internal data structures.
smallvecStores a few elements inline to avoid allocations on common small collections.
indexmapInsertion-ordered maps, especially useful for preserving user configuration and JSON object order.
ordered-floatMakes floating-point values usable in ordered keys and comparisons.
itertoolsIterator combinators beyond the standard library.
rand, rand_distrSampling, random IDs/choices, randomized behavior, and distributions.
regexPattern matching for transforms, filters, parsers, and configuration validation.
nomParser combinators, notably enabled for Nginx metrics and ClickHouse-specific parsing.
csvCSV decoding/encoding support.
quick-junitEmits JUnit test result data.
tempfileCreates temporary files and directories for runtime features and tests.
libc, nixUnix syscalls, sockets, signals, file descriptors, and resource limits.
socket2Lower-level socket setup where std::net is insufficient.
heimHost system metrics, used by the host_metrics source.
sysinfoSystem inspection support.
procfsLinux /proc parsing.
tikv-jemallocatorOptional Unix allocator selected by default on supported builds. It reduces allocator contention in allocation-heavy workloads.

HTTP, TLS and RPC

DependencyWhat it does / where it is used
httpHTTP 0.2 request, response, headers, methods, and status types.
http-1Renamed http 1.x, kept alongside 0.2.
http-bodyHTTP 0.4 body abstraction.
http-body-1Renamed HTTP body 1.x abstraction.
http-body-utilUtilities for collecting and transforming HTTP 1.x bodies.
hyperHTTP 0.14 client/server implementation.
hyper-1Renamed Hyper 1.x client.
hyper-utilHyper 1.x Tokio/client adapters, including legacy client compatibility.
axumHTTP routing and server-layer support
warpExisting HTTP server/filter implementation used by parts of the application.
headers, headers-1Typed HTTP header support for the two HTTP API versions.
h2Optional HTTP/2 protocol support, used by GCP Pub/Sub ingestion.
reqwestHTTP client
reqwest_13A renamed Reqwest 0.13 client, used where a newer HTTP stack is required alongside the 0.11 dependency.
hyper-proxyProxy-aware HTTP client support.
opensslVendored OpenSSL TLS and crypto implementation.
openssl-probeFinds system CA certificate locations where needed.
tokio-opensslAsync Tokio integration for OpenSSL streams.
hyper-openssl, hyper-openssl-1TLS connectors for the Hyper 0.14 and Hyper 1.x clients.
flate2gzip/deflate compression using zlib-rs.
zstdZstandard compression. Also used for compression dictionary generation in tests.
snapSnappy compression support.
async-compressionOptional asynchronous gzip and zstd streams, used by S3 input and file output.
base64Optional binary-to-text encoding used by protocols and cloud integrations.
hexOptional hexadecimal encoding, used by OpenTelemetry ingestion.
md-5Optional MD5 hashing for S3 object/checksum behavior.
prostOptional protobuf runtime used by Vector API, Vector protocol, Datadog, OpenTelemetry, Prometheus, GCP Pub/Sub, and dnstap.
prost-typesStandard protobuf well-known message types.
prost-reflectOptional runtime protobuf reflection, used by Datadog metrics.
prost-buildOptional build-time Rust code generation from .proto files.
tonicOptional gRPC client/server implementation for Vector API, Vector source/sink, GCP Pub/Sub, and other protobuf endpoints.
tonic-buildOptional build-time gRPC/protobuf code generation.
tonic-healthgRPC health service implementation.
tonic-reflectiongRPC reflection server support.
protobufAlternative protobuf runtime, used by Datadog metrics support.
openssl-srcBuild dependency that compiles/configures the OpenSSL source used by the vendored TLS setup.

Event model, codecs, and VRL

DependencyWhat it does / where it is used
mluaOptional vendored Lua 5.4 runtime used by the lua transform.
rmp-serdeOptional MessagePack serialization/deserialization through Serde. Used by Fluent and Datadog trace paths.
rmpvOptional dynamic MessagePack values, also used by Fluent and Datadog trace handling.
serde_bytesOptional efficient serialization of binary fields without expanding them into integer arrays.
arrowOptional Apache Arrow columnar-memory format support for Arrow and Parquet codecs, ClickHouse, and Databricks Zerobus.
parquetOptional Apache Parquet writer/reader support.
datadog-agent-metrics-v3Optional Datadog metrics-v3 columnar codec.
databricks-zerobus-ingest-sdkOptional Arrow Flight ingest client for the Databricks Zerobus sink.
roaringOptional compressed bitmap support for Splunk HEC source bookkeeping.
strip-ansi-escapesRemoves terminal ANSI escapes from text where Vector needs clean content.
syslogOptional syslog protocol support for the Papertrail sink.

Brokers and Messaging Systems

DependencyWhat it enables
lapinAMQP client for the AMQP source and sink.
async-rsAsync AMQP protocol/runtime support paired with lapin.
deadpoolManaged async connection pool for the AMQP sink.
rdkafkaKafka client for Kafka sources and sinks. Enables static curl, TLS, compression, and Tokio support.
async-natsNATS and JetStream client for NATS sources and sinks.
nkeysNATS NKey authentication.
pulsarApache Pulsar source and sink client.
redisRedis source and sink client, including connection manager and Sentinel support.
rumqttcMQTT source and sink client using Rustls.
mongodbMongoDB metrics source.
postgres-opensslOpenSSL TLS connector for PostgreSQL telemetry collection.
tokio-postgresPostgreSQL metrics source.
sqlxPostgreSQL sink and the MySQL-enabled Doris sink path.
databend-clientDatabend sink client.
greptimedb-ingesterGreptimeDB logs and metrics sinks.
maxminddbGeoIP and MMDB enrichment tables.
ipnetCIDR/IP-network handling for TCP source utilities.

Platform-specific Dependencies

PlatformDependenciesRole
Unixlibc, nixSignals, sockets, file descriptors, and resource handling.
Unixtikv-jemallocatorOptional default allocator on supported Unix builds.
Unixdnsmsg-parser, dnstap-parserdnstap source implementation.
Linuxprocfs/proc metrics and system data.
Linuxantithesis-instrumentationOptional Antithesis fault-testing instrumentation.
Windowswindows-sysBasic Windows FFI for foundations and threading.
Windowswindows-serviceWindows service integration.
WindowswindowsOptional higher-level Windows API bindings for the Windows Event Log source.
Windowsquick-xmlParses Windows Event Log XML records.
Windowsrdkafka with cmake_buildBuilds Kafka native dependencies on Windows.

Build-only Dependencies

DependencyWhat it does
prost-buildGenerates Rust types from protobuf files when the enabled feature requires them.
tonic-buildGenerates gRPC service/client code from protobuf definitions.
openssl-srcSupplies the vendored OpenSSL build used by the application’s TLS configuration.

Test and Benchmark Dependencies

DependencyWhat it does
approxFloating-point assertions with tolerances.
assert_cmdRuns a CLI as a child process and asserts stdout, stderr, and exit status.
criterionStatistical benchmarks, including async Tokio benchmarks and HTML reports.
mock_instantControllable clock for deterministic timing tests.
parking_lotFast locks in test scenarios.
proptest, proptest-deriveProperty-based test generation and derived arbitrary values.
quickcheckAnother property-based test framework.
rstestParameterized test macros.
serial_testSerializes tests that mutate global/shared state.
similar-assertsBetter diff output when assertions fail.
test-generatorGenerates repeated tests from declarative inputs.
tokio-testTokio-specific async testing helpers.
tower-testMocks and test helpers for Tower services.
wiremockMock HTTP server for integration-style client tests.
zstd with zdict_builderTrains compression dictionaries used to generate test fixtures.