my-rust-bin
generate the binary which links to different versions of a lib namedmy_rust_lib
, then call the functionpub fn my_rust_lib(left: usize, right: usize) -> usize
my-rust-lib-v1
generate the lib namedmy_rust_lib
in versionv1
my-rust-lib-v2
generate the lib namedmy_rust_lib
in versionv2
lib
is the directory which contains the lib ofmy_rust_lib
in any version
- Copy the library created in folder
my-rust-lib-v1
intolib
- Build the binary in folder
my-rust-bin
cd my-rust-bin
cargo build --features="v1"
- Validate the binary
- find out the binary
my-rust-bin
built in foldermy-rust-bin
- execute the binary via command
./my-rust-bin
,the output should be like below:
my_rust_lib_v1: 8
The return value of my_rust_lib is [8]
- Copy the library created in folder
my-rust-lib-v2
intolib
- Build the binary in folder
my-rust-bin
cd my-rust-bin
cargo build --features="v2"
- Validate the binary
- find out the binary
my-rust-bin
built in foldermy-rust-bin
- execute the binary via command
./my-rust-bin
,the output should be like below:
my_rust_lib_v2: 8
The return value of my_rust_lib is [8]