Stage 10.4: Writing A Library
A library has a root module in a file called lib.rs.
You can use cargo to create a new libray if you append the --lib
flag, e. g.
cargo new my-library --lib
.
This will create a src/lib.rs file for you.
A library has a root module in a file called lib.rs.
You can use cargo to create a new libray if you append the --lib
flag, e. g.
cargo new my-library --lib
.
This will create a src/lib.rs file for you.