Hi everybody,
I am trying to split in different files a models.rs file which contains all the structs of my database
So I create a directory models which contains the different files for each structs
I have read the documentation but It seems to be more complex
The compiler says:
unresolved import models::MyappPathology**
use models::MyappPathology;
no MyappPathology in models**
This file exists
Please help to understand how it works
if you want crate::modules::myapp_pathology::SomeStructName to work, then all the modules in the path must exist, so both mod modules in src/lib.rs, and then mod myapp_pathology in src/modules.rs or src/modules/mod.rs, and then it'll make a module from src/modules/myapp_pathology.rs.
You must declare every module, but you don't have to have a file on disk for every module. Instead of mod modules; loaded from file, you can have mod modules { /* content of the file goes here */ }