This was originally my "Rust Coding Test" solution for some company that I won't name here.
In a few words, the original problem sounds like: "you need to implement a transaction processor which takes a CSV file and prints resulting accounts state".
So it must be processed as:
To be sure of my solution, I added some cucumber scripts to test the behavior of the solution a little more solid.
The code is divided into the following modules:
- The module common defining constants, errors, traits Ledger, etc.
- The module basic defining basic implementation of Ledger with HashMap.
- The module libcsv defining csv processing functions.
The main program execute is in the src/bin subdirectory. It uses basic implementation of Ledger to process transactions from a CSV file.