Section IV - executable
Last updated
Was this helpful?
Last updated
Was this helpful?
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)
To save time on this Workshop, we will skip the create of integrated service tests for this RESTful service.
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.