3
rust 基础 (1) ——概览
source link: https://segmentfault.com/a/1190000040903673
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
二、基本介绍
三、工具链
3.2 cargo 基本使用
命令描述示例cargo new
创建新的项目cargo run
运行项目cargo build
编译项目 cargo vendor
将依赖下载到项目目录下 四、创建项目
4.1 项目结构
hello-rust |- Cargo.toml |- src |- main.rs文件说明示例
Cargo.toml
项目配置文件,说明版本信息、依赖关系等src/main.rs
应用代码4.2 添加依赖
[dependencies] ferris-says = "0.2"
执行 cargo build
会将依赖下载到$HOME/.cargo/registry
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK