当前位置: 首页 > news >正文

Rust开发环境搭建

Rust开发环境搭建

环境

rust: 1.79.0(2024-06-13)

1. Rustup下载器在线安装

windows:

https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe

unix:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

2. Rust独立安装包离线安装

windows:

https://static.rust-lang.org/dist/rust-1.79.0-x86_64-pc-windows-msvc.msi

linux:

https://static.rust-lang.org/dist/rust-1.79.0-x86_64-unknown-linux-gnu.tar.xz

macos:

https://static.rust-lang.org/dist/rust-1.79.0-x86_64-apple-darwin.pkg

3. Rust命令行

  • 查看rust版本
$ rustc -V
rustc 1.79.0
  • 新建rust项目
cargo new hello_world
  • cargo编译rust项目
$ cargo build
  • rustc编译rust项目
$ rustc src/main.rs
  • 运行rust程序
$ ./target/debug/hello_world
Hello, world!

4. IDE集成开发环境

4.1 VSCode

Rust with Visual Studio Code

4.2 vs2022

[User Manual (rust-analyzer.github.io)

5. 使用镜像加速cargo

$CARGO_HOME/config中加入如下内容

[source.crates-io]
replace-with = 'mirror'[source.mirror]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"

注:$CARGO_HOME:在 Windows 系统默认为:%USERPROFILE%\.cargo,在类 Unix 系统默认为:$HOME/.cargo


Reference:

  1. Other Installation Methods - Rust Forge (rust-lang.org)
http://www.lryc.cn/news/392935.html

相关文章:

  • 图文识别0难度上手~基于飞浆对pdf简易ocr并转txt
  • FFmpeg常用命令手册
  • CTF入门知识点
  • Leetcode 完美数
  • springboot中的定时任务编写
  • 第100+14步 ChatGPT学习:R实现随机森林分类
  • C#面 :ASP.Net Core中有哪些异常处理的方案?
  • 论文辅导 | 基于多尺度分解的LSTM⁃ARIMA锂电池寿命预测
  • 开关阀(4):对于客户技术要求信息的识别
  • Python统计实战:时间序列分析之二阶曲线预测和三阶曲线预测
  • Drools开源业务规则引擎(三)- 事件模型(Event Model)
  • 智慧校园行政办公升级,日程监控不可或缺
  • RedHat运维-Linux SSH基础3-sshd守护进程
  • 医院产科信息化管理系统源码,智慧产科管理系统,涵盖了从孕妇到医院初次建档、历次产检、住院分娩、统计上报到产后42天全部医院服务的信息化管理。
  • Softmax作为分类任务中神经网络输出层的优劣分析
  • 404白色唯美动态页面源码
  • 细说MCU的ADC模块单通道连续采样的实现方法
  • H2 Database Console未授权访问漏洞封堵
  • 基于java+springboot+vue实现的药店管理系统(文末源码+Lw)285
  • 网络爬虫基础
  • js数组方法归纳——push、pop、unshift、shift
  • VPN是什么?
  • 浅析DDoS高防数据中心网络
  • 《安全行业大模型技术应用态势发展报告(2024)》
  • 【基于R语言群体遗传学】-4-统计建模与算法(statistical tests and algorithm)
  • Java springboot校园管理系统源码
  • Lianwei 安全周报|2024.07.01
  • 柯桥职场英语学习商务英语口语生活英语培训生活口语学习
  • Spring与Quartz整合
  • C++之static关键字