Rust Development Guide
Relevant Rust source files
Cargo.tomlrust-toolchain.tomlMakefiledeny.tomlcrates/testkit/src/lib.rsCONTRIBUTING.mdRELEASES.md
The Nautilus workspace is a large Rust 2024 codebase with a pinned toolchain, shared dependency versions, feature-controlled crates, and strict CI. Work from the workspace root so Cargo resolves the same graph as continuous integration.
Development loop
- Install the toolchain from
rust-toolchain.tomland the repository-pinned developer tools. - Select the narrow crate or adapter under change.
- Format before review.
- Run Clippy with the same feature set and target family as the change.
- Run focused unit and integration tests, then the relevant workspace gate.
- Run benchmarks only when the change affects a measured hot path.
- Inspect feature combinations, generated artifacts, and documentation before submitting.
The root Makefile and scripts are the upstream operational entrypoints. Direct Cargo commands are useful for focused iteration, but a passing narrow command does not prove the workspace feature matrix or release policy.
Workspace discipline
All Nautilus crates share versions and many model types. Keep dependency changes centralized in the root workspace where possible. New features should be additive, avoid enabling expensive/default surfaces accidentally, and compile with default-features = false where the consuming runtime requires explicit control.
Unsafe code, FFI, network decoding, fixed-point conversion, replay ordering, and live execution changes require stronger evidence than ordinary refactors. Add correctness tests at the owning crate, integration tests at the crossed boundary, and a benchmark when latency or allocation behavior is part of the claim.
The following pages cover setup, CI, testing, quality, security, release, and contribution mechanics for the Rust workspace only.