Library Artifact(lib.rs)
We can create a library crate and then use it from one or more binary
crates
Library is mainly about code organization and reuse; it does not
automatically make the final executable smaller.
Create Library
|
Create an application that uses it
|
Types of Libraries
C++ Static(.a), Dynamic(.so)
Libraries
In Rust 3 types of libraries can be created:
| 1. Rust-specific static dependency(.rlib) | 2. staticlib(.a) | 3. Sharedlib(.so) | 4. Rust-to-Rust dynamic linking | |
|---|---|---|---|---|
| Cargo.toml |
|
|
|
|
| Code |
|
|
|
|