Rust 模块树
示例
档案:
-example.rs(root of our modules tree, generally namedlib.rsormain.rswhen using Cargo) - first.rs - second/ - mod.rs - sub.rs
模块:
- example -> example
- first -> example::first
- second -> example::second
- sub -> example::second::sub
- third -> example::thirdexample.rs
pub mod first;
pub mod second;
pub mod third {
...
}例如second,必须在example.rs文件中声明该模块,因为它的父级example不是(而不是),first因此不能first.rs 在同一目录级别的或另一个文件中声明该模块。
second/mod.rs
pub mod sub;
热门推荐
10 奶奶生日感恩祝福语简短
11 顾客简短祝福语大全集
12 简短的祝福语12字
13 对疫情的简短祝福语
14 新年祝福语长篇文案简短
15 圣诞饭店祝福语大全简短
16 圣诞祝福语简短小学
17 端午发给客户祝福语简短
18 大雪生日祝福语大全简短