头图

One, reference

rust series article directory-update ing

Getting started

2. Basic introduction

Three, tool chain

image.png

3.2 Basic use of cargo

OrderdescribeExample
cargo newCreate a new projectimage.png
cargo runRun the projectimage.png
cargo buildCompile the project
cargo vendorDownload the dependencies to the project directory

Fourth, create a project

4.1 Project structure

hello-rust
|- Cargo.toml
|- src
  |- main.rs
documentillustrateExample
Cargo.tomlProject configuration file, indicating version information, dependencies, etc.image.png
src/main.rsApplication codeimage.png

4.2 Add dependency

[dependencies]
ferris-says = "0.2"

Executing cargo build will download dependencies to $HOME/.cargo/registry


一曲广陵散
76 声望21 粉丝

柴米油盐酱醋茶