rust_module/
lib.rs

1pub mod healthy_food{
2    
3        pub mod fruits{
4            #[derive(Debug)]
5            pub enum Fruit{
6                Mango,
7                Banana,
8                Apple,
9            }
10        }
11
12        pub mod vegetables{
13            pub struct Vegetable{
14                pub Name: String,
15                pub IsSeasonal: bool
16            }
17
18            impl Vegetable {
19                pub fn print_vegetable(&self){
20                    println!("I have selected {} and it is {}.", self.Name, check_seasonal(self.IsSeasonal));
21                }
22            }
23            
24            pub fn check_seasonal(is_seasonal:bool) -> String{
25                if is_seasonal {
26                    "seasonal".to_string()
27                }else{
28                    "non-seasonal".to_string()
29                }
30            }
31        }
32    }