This is my directory structure
src/
├── lib.rs
├── pages/
│ ├── mod.rs
│ ├── home_page.rs
└── components/
├── mod.rs
└── header.rs
Inside my pages/home_page.rs
I try to access my pub struct Header
which is inside components/header.rs
.
My components/mod.rs
looks like this: pub mod header;
which works fine because inside lib.rs
- I can use it like:
mod components;
use components::header::Header;
However, I don't know how to access it in pages/homepage.rs
. How can get access to that struct? Is it something in Cargo.toml?