mod 引入别的文件模块,写一个命名控件 mod 相当于ts 的 import mod toy { pubfnrun() { println!("run toy"); } } fn main() { toy::run(); } // src/toy_implements.rs pub fn run() { println!("run toy_impl !"); } // fn main() { toy::run(); }