Before going any further, we need to talk about how file hierarchy works in Rust through its modules.
The first thing to know is that files and folders are handled as modules in Rust. Consider the following:
|- src/ | |- main.rs |- another_file.rs
If you want to declare that a module is in the another_file.rs file, you'll need to add to your main.rs file:
mod another_file;
You will now have access to everything contained in another_file.rs (as long as it's public).
Another thing to know: you can only declare modules whose files are on the same level as your current module/file. Here's a short example to sum this up:
|- src/ | |- main.rs |- subfolder/ |- another_file.rs
If you try to declare a module referring to another_file.rs directly into main.rs, as shown preceding, it'll fail because there...