user-1362/rust-ecs-server icon
public
Published on 4/10/2025
user-1362/rust-ecs-server

Rules for rust ecs server

Rules

Build & Development Commands

  • Follow Rust coding standards
  • Avoid unsafe features
  • Use Result and Option to handle errors explicitly.
  • Use tokio-based asynchronous processing as the default, but avoid it in ECS logic system functions where builds are likely to break; instead, use tokio bounded channels. Only in areas with potential performance bottlenecks, and employ rayon’s par_iter for parallelization when needed.
  • Use function and variable names that clearly convey intent, and break logic into small units.

Testing Guidelines

  • Write unit tests for all major functions and regularly verify them with cargo test.
  • If tests are anticipated to require significant execution time, use the #[tokio::test] attribute to support asynchronous testing with tokio.

Code Style & Guidelines

  • Write it according to the cargo fmt format.

Documentation Guidelines

  • Add Rustdoc comments (///) to public APIs to provide usage instructions and examples.