Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // data/something.rs
- pub struct MyStruct {
- pub id: u32, // public property
- value: u32, // can not be used outsode of something.rs
- }
- // data/mod.rs
- pub mod something; // <-- this exposes data::something to anything "using" data
- // main.rs
- mod data;
- use data::something::MyStruct;
- fn main() {
- }
Add Comment
Please, Sign In to add comment