From the course: Generative AI and Large Language Models on AWS

Unlock this course with a free trial

Join today to access over 24,000 courses taught by industry experts.

Diagram: Rust Axum Greedy Coin microservice

Diagram: Rust Axum Greedy Coin microservice

- [Instructor] Here we have a Rust Axum Greedy Coin Microservice. Let's break up each of these components into its segment and talk about it. First we have the microservice it itself. It uses the Tokio framework to get async capabilities. So it's one of the fastest frameworks that's available. So that's one of the pluses of it. And you can see it's pretty intuitive as well. If you go to the route change, it's going to accept the dollars and cents parameter and then it's going to pass it to a change function. Now the other thing to be aware of is that I've divided the logic into a lib.rs directory. That's a pattern that is a nice pattern to really separate things so that you have the controller, which is the microservice, and then you have the business logic in a library here. And you can see it's a pretty simple function. It uses the greedy heuristic here that is able to first take the largest coins and process as many as it can with the largest coins, which are the 25 cent pieces…

Contents