Libraries

C++ programs tend to either use libraries that come with operating system distributions or that are vendored.

Rust programs tend to rely on a central registry of Rust libraries ("crates") called crates.io (along with a central documentation repository created from the in-code documentation of those crates called docs.rs). Dependencies on crates are managed using the Cargo package manager.

Lib.rs is a good resource for finding popular crates organized by category.

Some specific alternatives

C++ libraryRust alternative
STL UTF-16 and UTF-32 stringswidestring
STL randomrand
STL regexregex
Boost.Testcargo test
pybind11PyO3
OpenSSLrustls

If there is a C++ library that you use where you cannot find a Rust alternative, please leave feedback using the link below, letting us know the name and purpose of the library.

Supply chain management

In situations where managing the library supply chain is important, Cargo can be used either with custom self-managed or organization-managed registries or with vendored versions of dependencies fetched from crates.io.

Both approaches provide mechanisms for reviewing dependencies as part supply chain security.

Solutions for supply chain security that do not involve vendoring or custom registries are in progress.