Module guide

A Guide to the rustmax crate.

Category Crates
error handling and debugging anyhow, env_logger, log, thiserror
collections ahash, bitflags, bytes, itertools
numerics num_bigint
encoding, serialization, parsing base64, comrak, flate2, hex, json5, memchr, nom, regex, serde, serde_json, toml, zip
time chrono, jiff
random numbers rand, rand_chacha, rand_pcg
cryptography blake3, sha2
parallelism crossbeam, rayon
asynchronous I/O futures, tokio
networking and web axum, http, hyper, mime, reqwest, socket2, tera, tower, url
text / unicode unicode_segmentation
convenience macros cfg-if, derive_more, extension-trait, num_enum, powerletters
terminal / CLI clap, ctrlc, indicatif, termcolor, rustyline
system / OS glob, ignore, notify, tempfile, walkdir, xshell
graphics / images image
testing proptest
FFI / interop libc, bindgen, cc, cxx, cxx-build
build scripts …
deployment and software lifecycle semver
procedural macros proc-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-rustlib-core and rmx-rustlib-alloc.

Crates in rmx-profile-no-std

🌎 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-feature-derive.
πŸ’‘ This profile also enables rmx-feature-serde.
πŸ’‘ This profile also enables rmx-rustlib-core, rmx-rustlib-alloc, and rmx-rustlib-std.

Crates in rmx-profile-std

🌎 Profile: rmx-profile-wasm

This profile is designed for WebAssembly (WASM) targets. It includes all crates from rmx-profile-no-std, plus additional crates that are compatible with WASM environments.

This profile uses WASM-specific variants of ecosystem features that exclude features incompatible with WASM environments, such as OS-specific threading APIs and file system operations that require native OS support.

πŸ’‘ This profile also enables rmx-rustlib-core, rmx-rustlib-alloc, and rmx-rustlib-std.
πŸ’‘ This profile also enables rmx-feature-std-wasm.
πŸ’‘ This profile also enables rmx-feature-default-wasm.
πŸ’‘ This profile also enables rmx-feature-more-wasm.
πŸ’‘ This profile also enables rmx-feature-derive.
πŸ’‘ This profile also enables rmx-feature-serde.

Crates in rmx-profile-wasm

All crates from rmx-profile-no-std, plus:

Note: Some crates from rmx-profile-std are not included because they require native OS features unavailable in WASM environments: proptest, tera, xshell.

🌎 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

🌎 Profile: rmx-profile-cli

Crates for building commandline interfaces.

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

Crates in rmx-profile-cli

🌎 Profile: rmx-profile-build-script

Crates for writing Rust build scripts.

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

Crates in rmx-profile-build-script

🌎 Profile: rmx-profile-proc-macro

Crates for writing Rust procedural macros.

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

Crates in rmx-profile-proc-macro

🌎 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-std-wasm

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

Similar to rmx-feature-std, but excludes features that are incompatible with WebAssembly targets, such as those requiring threading or OS-specific APIs.

β›² 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-default-wasm

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

Similar to rmx-feature-default, but uses WASM-compatible default features where necessary.

β›² 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-more-wasm

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

Similar to rmx-feature-more, but excludes features that are incompatible with WebAssembly targets, such as blocking I/O and threading.

β›² 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. These features enable reexports of the corresponding standard library crates as modules within rustmax.

πŸ“™ Rustlib: rmx-rustlib-core

Reexports the core library. Enabled by rmx-profile-no-std and all profiles that include it.

πŸ“™ Rustlib: rmx-rustlib-alloc

Reexports the alloc library. Enabled by rmx-profile-no-std and all profiles that include it.

πŸ“™ Rustlib: rmx-rustlib-std

Reexports the std library. Enabled by rmx-profile-std and all profiles that include it.

πŸ“™ Rustlib: rmx-rustlib-proc_macro

Reexports the proc_macro library. Enabled by rmx-profile-proc-macro.

Using rustmax as a library.

In your manifest Cargo.toml:

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

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

[dependencies]
rmx.version = "0.0.7"
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.7"
rmx.features = [
  "rmx-profile-max",
]

Crate reexports

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

# use rustmax as rmx;
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