LINEUP & SCHEDULE

大規模プロダクトのための Cargo Workspace ベストプラクティス

  • Track A

  • 11:20 - 11:45 (JST)

    • Session Language: 日本語

In large-scale product development in Rust, using modules (mod) to separate functionality makes it difficult to manage the responsibilities of each component. Cargo Workspace allows to manage multiple crates in a single place, making it easier to separate responsibility.

Especially when developing a backend product, each component responsibility may want to use different dependencies. Using Cargo Workspace to separate the crates also separates the Cargo.toml, making it easier to manage dependencies.

I would like to share best practices based on my experience of 3 years of continuous backend development of our own products. Examples of good and bad points are as follows.

  • How to consist versions of dependencies in own crates (solved in workspace.dependencies in 1.64.0)
  • How to handle common types
  • It is easier to mock APIs of external services
  • When using Procedural macro, it is necessary to separate the crates, but the crates can be in the same workspace
  • It is good to match the prefix or suffix of each crate's name
  • To publish to crates.io, cargo-release is useful.
  • etc.

Share it on


Bio

名和雅実

名和雅実

Fairy Devices Inc., Product Development Department, Engineer


Copyright © Rust.Tokyo 2024 all rights reserved.


特定商取引法に基づく表示

ぜひフォローしてください! @rustlang_tokyo

お問い合わせ: rust-tokyo-staff@googlegroups.com

過去の開催