I have this file structure:
src
├── core
│ ├── game.rs
│ ├── math.rs
│ └── screen.rs
├── core.rs
└── main.rs
Inside of core/screen.rs I have a struct Screen. I can use this struct and its function in main.rs like
mod core;
fn main() {
let s = core::screen::Screen::new();
}
That works, however the problem is, inside of core/game.rs I can't use that same struct.
I've tried use and mod but I can't figure it out.
Inside core/game.rs
pub struct Game {
screen: ?????? // Should be core::screen::Screen?
}
And for those wondering, the contents of core.rs looks like
pub mod math;
pub mod screen;
pub mod game;
Right now the core.rs file doesn't exactly have a use except for a very weird namespace almost but it will have functions in the future.
coreas a module name, to avoid conflict/ambiguity with The Rust Core Library.