Development tips: getting started developing in rust on ztunnel #153
Labels
lifecycle/staleproof
Indicates a PR or issue has been deemed to be immune from becoming stale and/or automatically closed
Since most developers on the project are new to rust, I thought it would be useful to have an issue to discuss tips for onboarding. Feel free to edit or comment.
IDEs
Intellij (or related IDEs) have a rust plugin that is pretty solid, with some tweaks:
VSCode or other LSP editors with rust-analyze is also great.
Note: due to the complexity of the language, the experience of both of these is still worse than Go unfortunately
Useful commands
Resources
https://doc.rust-lang.org/book/ - the canonical learning rust book.
https://www.zero2prod.com/ - good real world walkthrough
https://tokio.rs/tokio/tutorial - good intro to async and tokio (library we use)
Coding style
Rust allows a wide variety of coding styles. Because most developers on the project are new-er to Rust, avoid use of complex Rust features when possible. If a function doesn't need to be generic, do not make it so. If a we can save 10nanoseconds on a infrequent codepath by using complex lifetimes - opt for a clone() instead.
Running locally
See https://github.com/istio/ztunnel/blob/master/LOCAL.md
Useful tools
https://nexte.st/ - Better test runner
The text was updated successfully, but these errors were encountered: