Guest User

Untitled

a guest
Apr 26th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. // data/something.rs
  2. pub struct MyStruct {
  3. pub id: u32, // public property
  4. value: u32, // can not be used outsode of something.rs
  5. }
  6.  
  7. // data/mod.rs
  8. pub mod something; // <-- this exposes data::something to anything "using" data
  9.  
  10. // main.rs
  11. mod data;
  12.  
  13. use data::something::MyStruct;
  14.  
  15. fn main() {
  16. }
Add Comment
Please, Sign In to add comment