Crate rustmax

Source
Expand description

A collection of Rust crates.

🚧 WARNING: Do not use this project. It is neither stable nor supported. 🚧

This crate documents and reexports selected high-quality Rust crates suitable for many Rust programs. Through the organization of its Cargo features into profiles and ecosystem features, with consistent descriptions of individual crates, it is a guide to the Rust crate ecosystem. It can be read as reference documentation or imported through a Cargo dependency as a β€œbatteries included” supercrate.




CategoryCrates
error handling and debugginganyhow, backtrace, env_logger, log, thiserror
collectionsahash, bitflags, bytes, itertools
numericsnum_bigint
encoding, serialization, parsingbase64, byteorder, hex, json5, nom, regex, serde, serde_json, toml
timechrono, jiff
random numbersrand, rand_chacha, rand_pcg
cryptographyblake3, sha2
parallelismcrossbeam, rayon
asyncronous I/Ofutures, tokio
networking and webaxum, http, hyper, mime, reqwest, socket2, tera, tower, url
text / unicodeunicode_segmentation
convenience macroscfg-if, derive_more, extension-trait, num_enum
terminal / CLIclap, ctrlc, termcolor, rustyline
system / OSnum_cpus, tempfile, walkdir, xshell
testingproptest, static_assertions
FFI / interoplibc, bindgen, cc, cxx, cxx-build
build scripts…
deployment and software lifecyclesemver
procedural macrosproc-macro2, quote, syn






Β§Profiles

rustmax organizes crates into profiles, which correspond to common target environments and application types.

By default no profile is enabled and no crates are exported.

§🌎 Profile: rmx-profile-no-std

This profile includes crates that do not require Rust std. It allows use of the Rust allocator, and enables allocator-related features of its crates. All crates in this profile are also in rmx-profile-std.

πŸ’‘ This profile also enables rmx-feature-no-std.
πŸ’‘ This profile also enables rmx-rustlibs-no-std.

Β§Crates in rmx-profile-no-std

  • ahash - A fast and DOS-resistent hash function, for use in HashMaps.
  • anyhow - Easy error handling.
  • backtrace - Callstack backtraces on demand.
  • base64 - Base-64 encoding and decoding.
  • bitflags - Types in which the bits are individually addressable.
  • blake3 - The BLAKE3 cryptographic hash function.
  • byteorder - Big-endian and little-endian encoding.
  • bytes - Abstractions for working with byte buffers: Bytes, Buf, and BufMut.
  • cfg-if - A macro for writing conditional compilation as if / else blocks.
  • chrono - Dates and time (legacy).
  • crossbeam - Concurrency tools to supplement std::sync, including fast channels.
  • derive_more - derive for more standard traits.
  • extension-trait - A macro for defining extension methods to external types.
  • futures - Abstractions for asynchronous programming.
  • hex - Encoding and decoding hexidecimal strings.
  • itertools - Additional methods for iterators.
  • jiff - Dates and time.
  • libc - Bindings to the C standard library.
  • log - A simple logging framework.
  • nom - An efficient parser combinator.
  • num_bigint - Arbitrary-sized integers.
  • num_enum - Conversions between numbers and enums.
  • proptest - Testing over generated inputs, ala QuickCheck.
  • rand - Random number generators.
  • rand_chacha - The ChaCha cryptographically-secure random number generators.
  • rand_pcg - The PCG non-cryptographically-secure random number generators.
  • semver - The software versioning standard used by Rust.
  • serde - The standard Rust serialization framework.
  • serde_json - JSON serialization / deserialization with serde.
  • sha2 - The SHA2 cryptographic hash functions.
  • static_assertions - Compile-time assertions about constants, types, etc.
  • toml - TOML serialization / deserialization with serde.

§🌎 Profile: rmx-profile-std

This profile depends on the Rust standard library, and includes crates that require the Rust standard library, in addition to the crates provided by rmx-profile-no-std.

πŸ’‘ This profile also enables rmx-feature-std.
πŸ’‘ This profile also enables rmx-feature-default.
πŸ’‘ This profile also enables rmx-feature-more.
πŸ’‘ This profile also enables rmx-rustlibs-std.

Β§Crates in rmx-profile-std

  • clap - Command line parsing.
  • env_logger - A basic logger to use with the log crate.
  • json5 - JSON5, a superset of JSON with expanded syntax.
  • num_cpus - Get the number of CPUS on a machine.
  • rayon - Parallel iterators and other parallel processing tools.
  • regex - Regular expressions.
  • tempfile - Temporary files and directories.
  • tera - A text template engine based on Jinja2.
  • thiserror - Tools for defining custom error types.
  • unicode-segmentation - Splitting strings on grapheme cluster, word, and sentence boundaries.
  • walkdir - Efficient directory traversal.
  • xshell - A Swiss-army knife for writing shell-style scripts in Rust.

§🌎 Profile: rmx-profile-net

Adds networking crates, including the tokio async runtime.

Not that this profile does not enable tokio features for other crates; to enable tokio features apply the rmx-feature-tokio feature.

πŸ’‘ This profile also enables rmx-profile-std.

Β§Crates in rmx-profile-net

  • axum - Web application framework based on tokio.
  • http - Shared definitions related to the HTTP protocol.
  • hyper - HTTP, versions 1 and 2.
  • mime - MIME media types.
  • reqwest - Simple HTTP requests, synchronous and asynchronous.
  • socket2 - Low-level network socket programming beyond std::net.
  • tokio - An async task runtime and I/O library.
  • tower - Service request/response abstraction (HTTP middleware) for tokio and axum.
  • url - URL parsing and data structures.

§🌎 Profile: rmx-profile-cli

Crates for building commandline interfaces.

πŸ’‘ This profile also enables rmx-profile-std.

Β§Crates in rmx-profile-cli

  • ctrlc - Simple handling of Ctrl-C for CLI programs.
  • termcolor - Cross-platform library for writing colored output to the terminal.
  • rustyline - Command-line input reading with history.

§🌎 Profile: rmx-profile-build-script

Crates for writing Rust build scripts.

πŸ’‘ This profile also enables rmx-profile-std.

Β§Crates in rmx-profile-build-script

  • bindgen - Generate Rust bindings to C and C++ libraries.
  • cc - A basic cross-platform C/C++ compiler driver.
  • cxx - C++ bridge runtime support; paired with cxx_build.
  • cxx-build - C++ bridge generator; paired with cxx.

§🌎 Profile: rmx-profile-proc-macro

Crates for writing Rust procedural macros.

πŸ’‘ This profile also enables rmx-profile-std.
πŸ’‘ This profile also enables rmx-rustlibs-proc-macro.

Β§Crates in rmx-profile-proc-macro

  • proc-macro2 - A preferred wrapper around the standard proc_macro crate.
  • quote - The quote! macro for turning code blocks into source tokens.
  • syn - A Rust parser used by procedural macros.

§🌎 Profile: rmx-profile-full

This profile simply enables all previous profiles.

πŸ’‘ This profile also enables rmx-profile-std.
πŸ’‘ This profile also enables rmx-profile-net.
πŸ’‘ This profile also enables rmx-profile-cli.
πŸ’‘ This profile also enables rmx-profile-build-script.
πŸ’‘ This profile also enables rmx-profile-proc-macro.

§🌎 Profile: rmx-profile-max

rustmax with all features (that don’t require nightly).

πŸ’‘ This profile also enables rmx-profile-full.
πŸ’‘ This profile also enables rmx-feature-derive.
πŸ’‘ This profile also enables rmx-feature-serde.
πŸ’‘ This profile also enables rmx-feature-backtrace.
πŸ’‘ This profile also enables rmx-feature-tokio.

§🌎 Profile: rmx-profile-max-nightly

rustmax with all features (including nightly).

πŸ’‘ This profile also enables rmx-profile-max.
πŸ’‘ This profile also enables rmx-feature-nightly.

Β§Ecosystem features

rustmax identifies Cargo features common across many crates.

Β§β›² Feature: rmx-feature-no-std

This feature is enabled by rmx-profile-no-std. It does not typically need to be set manually.

It enables few features, particularly enabling allocator support for no-std crates that can be compiled without.

Β§β›² Feature: rmx-feature-std

This feature is enabled by rmx-profile-std. It does not typically need to be set manually.

It enables the β€œstd” feature of crates and other default features that require the standard library.

Β§β›² Feature: rmx-feature-default

This feature is enabled by rmx-profile-std. It does not typically need to be set manually.

It enables the β€œdefault” feature of crates.

Β§β›² Feature: rmx-feature-more

This feature is enabled by rmx-profile-std. It does not typically need to be set manually.

This activates extra crate features for convenience that the crates themselves do not typically activate by default.

Β§β›² Feature: rmx-feature-derive

Enables derive macros of crates where it is optional, typically with a feature named β€œderive”.

Β§β›² Feature: rmx-feature-serde

Enables serde support for crates where it is optional, typically with a feature named β€œserde”.

Β§β›² Feature: rmx-feature-backtrace

Enables backtrace support for crates where it is optional, typically with a feature named β€œbacktrace”.

This feature is necessary for backtrace support in anyhow.

This feature also enables rmx-feature-std.

Β§β›² Feature: rmx-feature-tokio

Enables tokio support for crates where it is optional, typically with a feature named β€œtokio”.

Β§β›²Feature: rmx-feature-nightly

Enables features that only compile with the Rust [nightly compiler], typically with a feature named β€œnightly”.

Β§Rust standard libraries

rustmax re-exports the standard Rust libraries for convenience.

Β§πŸ“™ Rustlib: rmx-rustlibs-no-std

Β§πŸ“™ Rustlib: rmx-rustlibs-alloc

Β§πŸ“™ Rustlib: rmx-rustlibs-std

Β§πŸ“™ Rustlib: rmx-rustlibs-proc-macro

Β§Using rustmax as a library.

In your manifest Cargo.toml:

[dependencies]
rmx.package = "rustmax"
rmx.version = "0.0.4"
rmx.features = [
  "rmx-profile-max",
]

Or if using a workspace, in your workspace Cargo.toml

[dependencies]
rmx.version = "0.0.4"
rmx.features = [
  "rmx-profile-max",
]

And in your crate’s Cargo.toml

[dependencies]
rmx.workspace = true

Β§rustmax and cargo features

todo

The main way of configuring the rustmax crates is by enabling the appropriate profile cargo features.

rustmax enables no features by default, and reexports no crates; but for most uses people will want to enable rmx-profile-std. This feature augments the Rust std library with crates that are widely used with a variety of Rust programs, as well as minor helpers missing from the standard library.

[dependencies]
rmx.package = "rustmax"
rmx.version = "0.0.4"
rmx.features = [
  "rmx-profile-max",
]

Β§Crate reexports

The crates of rustmax are all reexported as modules from the rustmax crate.

β“˜
use rmx::rand::Rng;

These modules should generally behave the same as the corresponding crates, with exceptions noted in β€œKnown Bugs”. These modules have have rustmax-specific module-level documentation, with a short description and motivation, an example, and relevant links, including to the original crate-level documentation.

These modules are only defined when their crate is configured through cargo features like rmx-profile-std.

Β§The rustmax prelude

Β§The extras module

Β§Known bugs

  • serde derive only works if the serde crate is an explicit dependency.
  • derive_more derives only works if the derive_more crate is an explicit dependency.

Modules§

  • A fast and DOS-resistent hash function, for use in HashMaps.
  • The Rust core allocation and collections library
  • Easy error handling.
  • Web application framework based on tokio.
  • Callstack backtraces on demand.
  • Base-64 encoding and decoding.
  • Generate Rust bindings to C and C++ libraries.
  • Types in which the bits are individually addressable.
  • The BLAKE3 cryptographic hash function.
  • Big-endian and little-endian encoding.
  • Abstractions for working with byte buffers: Bytes, Buf, and BufMut.
  • A basic cross-platform C compiler driver.
  • A macro for writing conditional compilation as if / else blocks.
  • Dates and time (legacy).
  • Command line parsing.
  • The Rust Core Library
  • Concurrency tools to supplement std::sync, including fast channels.
  • Simple handling of CTRL-C for CLI programs.
  • C++ bridge runtime support; paired with cxx_build.
  • C++ bridge generator; paired with cxx.
  • derive for more standard traits.
  • A basic logger to use with the log crate.
  • A macro for defining extension methods to external types.
  • Additional tidbits defined by rmx.
  • Abstractions for asynchronous programming.
  • Encoding and decoding hexidecimal strings.
  • Shared definitions related to the HTTP protocol.
  • HTTP, versions 1 and 2.
  • Additional methods for iterators.
  • Dates and time.
  • JSON5, a superset of JSON with expanded syntax.
  • Bindings to the C standard library.
  • A simple logging framework.
  • MIME media types.
  • An efficient parser combinator.
  • Arbitrary-sized integers.
  • Get the number of CPUS on a machine.
  • Conversions between numbers and enums.
  • The rmx prelude.
  • A support library for macro authors when defining new macros.
  • A preferred wrapper around the standard proc_macro crate.
  • Testing over generated inputs, ala QuickCheck.
  • The quote! macro for turning code blocks into source tokens.
  • Random number generators.
  • The ChaCha cryptographically-secure random number generators.
  • The PCG non-cryptographically-secure random number generators.
  • Parallel iterators and other parallel processing tools.
  • Regular expressions.
  • Simple HTTP requests, synchronous and asynchronous.
  • Command-line input reading with history.
  • The software versioning standard used by Rust
  • The standard Rust serialization framework.
  • JSON serialization / deserialization with serde.
  • The SHA2 cryptographic hash functions.
  • Low-level network socket programming beyond std::net.
  • Compile-time assertions about constants, types, etc.
  • The Rust Standard Library
  • A Rust parser used by procedural macros.
  • Temporary files and directories.
  • A text template engine based on Jinja2.
  • Cross-platform library for writing colored output to the terminal.
  • Tools for defining custom error types.
  • An async task runtime and I/O library.
  • TOML serialization / deserialization with serde.
  • Service request/response abstraction (HTTP middleware) for tokio and axum.
  • Splitting strings on grapheme cluster, word, and sentence boundaries.
  • URL parsing and data structures.
  • Efficient directory traversal.
  • A Swiss-army knife for writing shell-style scripts in Rust.

Macros§

  • Like β€˜unimplemented’ but shorter to type.