It's great to hear that you've been experimenting with Rust and have noticed significant improvements in memory consumption compared to your PHP and C# implementations. It seems like Rust is well-suited for the task, especially considering its focus on performance and memory safety.
As for making your Rust implementation even better and more idiomatic, there are a few things you could consider:
Error handling: Rust has a robust and expressive error handling system using the Result and Option types. Make sure to leverage Rust's error handling capabilities to handle errors in a more structured and ergonomic way.
Use Rust's standard libraries: Rust provides a rich standard library that includes modules for networking (e.g., hyper), serialization (e.g., serde), and many other common tasks. Leveraging these standard libraries can improve the maintainability and performance of your code.
Concurrency: Rust has great support for concurrent programming through constructs like threads and async/await. Depending on the nature of your API, you might consider utilizing Rust's concurrency features to improve performance and responsiveness.
Memory safety: Although it seems like you're already benefiting from Rust's memory safety features, it's always good to be mindful of memory management in your code. Avoiding unsafe code and using Rust's ownership and borrowing system effectively can prevent common memory-related issues.
Community and best practices: Engaging with the Rust community and learning about best practices can provide valuable insights into how to architect your Rust code in the most idiomatic and efficient way.
Overall, it sounds like you're off to a great start with Rust, and there's plenty of room to continue refining and optimizing your API implementation. Feel free to ask more specific questions or share any particular challenges you encounter as you continue your Rust journey!
As the result, if it is ongoing project, I wanna participate in your project