// src/main.rs: the main file of the project, where the main function is defined; this is the crate root // src/lib.rs: the root of your crate’s library; the library’s name is the same as the name of the crate // src/bin: directory that can contain multiple binary crates; each file in this directory will be a separate binary crate // src/bin/main.rs: the main file of the binary crate with the same name as the directory; this file is the crate root of the binary crate
//Modules use std::collections::HashMap;// use keyword to bring module into scope
use std::io::Resultas IoResult;// use keyword to bring module into scope use std::{cmp, io};// use keyword to bring module into scope use rand::Rng;// use keyword to bring module into scope use std::collections::*;// use keyword to bring module into scope, * is glob operator
pubuse crate::front_of_house::hosting;// use keyword to bring module into scope //use crate::front_of_house::servering;// cannot use private module //use front_of_house::hosting;// relative path
// Order a breakfast in the summer with Rye toast letmut meal = front_of_house::Breakfast::summer("Rye"); // Change our mind about what bread we'd like meal.toast = String::from("Wheat"); println!("I'd like {} toast please", meal.toast); // The next line won't compile if we uncomment it; we're not allowed // to see or modify the seasonal fruit that comes with the meal // meal.seasonal_fruit = String::from("blueberries");