Section IV - executable
We are now ready to write the executable. To do this, we will working with the following files:
Cargo.toml (manifest)
src/bin/daas-reporting.rs (executable)
Tests
To save time on this Workshop, we will skip the create of integrated service tests for this RESTful service.
Code
Declaring the Executable
In the Cargo.toml
file, after the that last [[bin]]
statement for status_processor, add the following declaration.
This will tell Cargo that there is a binary file to be compiled and to name the exeutable reporting.
Coding the Executable
Let's begin by creating a file named daas-reporting.rs
in the src/bin/
directory.
At the top of the file, we will start be declare the dependent crate with macros and the use
statements.
Lastly, we define the main()
function that will be called by the executable.
Last updated
Was this helpful?