tutorial_1/
lib.rs

1// libray crate often provides basic services, like:
2// adding products, maintaining customer data and processing order
3// and we want products, customers and orders separated to different modules
4
5// this cannot be used, becaues the product is not public , even though its inner module category is public
6// but out of the scope of the product, it still unavailable
7
8// pub + use module::items can let those items be public in the scope of the project,
9// because it is lib.rs shared across the project
10pub use customer::Customer;
11pub use order::Order;
12pub use product::category::Category;
13pub use product::Product;
14
15/// use crate::product::category;
16/// Struct for storing product related information. 
17mod product;
18
19// here we also need to know, make a module public
20// it's inner variables like structs or functiosn will not become public automatically and iteratively
21mod customer;
22
23mod order;