About this Crate

Sections

I crate a workspace

```bash

create a workspaces

mkdir workpsaces && cd workpsaces

create a workspace 'hello-world'

mkdir hello-world && cd hello-world

create a configration for the workspace

touch Cargo.toml

four crates for this workspace

the follow lines is ONE command

echo '[workspace] members = ["lib-hello", "bin-hello", "bin-local-hello", "lib-extern"]' >> Cargo.toml ```

II develop the crate

1 create the default crate

```bash mkdir lib-hello && cd lib-hello

this is Crate Root Path

cargo init --name hello_exercism --lib ```

2 develop the crate source and test codes for folder 'tests'

bash vi src/lib.rs mkdir -p src/integration_tests touch src/integration_tests/mod.rs vi src/integration_tests/mod.rs touch src/integration_tests/i_hello.rs vi src/integration_tests/i_hello.rs mkdir -p src/private_tests touch src/private_tests/mod.rs vi src/private_tests/mod.rs touch src/private_tests/owned_hello.rs vi src/private_tests/owned_hello.rs cargo test

5 publish the own crate to crates.io

```bash

run the follow commant at A time

cargo login

can repeat the follow commands

cargo test

commit and push the codes

cargo package cargo publish ```

III use the crate

1 create the default Bin

```bash mkdir bin-hello && cd bin-hello

this is Bin Root Path

cargo init --name bin-hello --bin ```

2 configure the file Cargo.toml

fn main () { println!("{}",helloexercism::hello()); asserteq!("Hello, World!", hello_exercism::hello()); } ```

4 run the Bin program

IV create the crate doc in local version

V create the crate doc in server version