3

rust 基础 (1) ——概览

 2 years ago
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.
neoserver,ios ssh client

rust 系列文章目录——更新ing

Getting started

二、基本介绍

三、工具链

3.2 cargo 基本使用

命令描述示例cargo new创建新的项目cargo run运行项目cargo build编译项目 cargo vendor将依赖下载到项目目录下

四、创建项目

4.1 项目结构

hello-rust
|- Cargo.toml
|- src
  |- main.rs
文件说明示例Cargo.toml项目配置文件,说明版本信息、依赖关系等image.pngsrc/main.rs应用代码image.png

4.2 添加依赖

[dependencies]
ferris-says = "0.2"

执行 cargo build会将依赖下载到$HOME/.cargo/registry


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK