Rust 跑的例子
Rust 一门赋予每个人构建可靠且高效软件能力的语言
安装
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 提示失败
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
info: downloading installer
-
curl: (60) SSL certificate problem: certificate has expired
-
More details here: https://curl.haxx.se/docs/sslcerts.html
-
-
curl performs SSL certificate verification by default, using a "bundle"
-
of Certificate Authority (CA) public keys (CA certs). If the default
-
bundle file isn't adequate, you can specify an alternate file
-
using the --cacert option.
-
If this HTTPS server uses a certificate signed by a CA represented in
-
the bundle, the certificate verification probably failed due to a
-
problem with the certificate (it might be expired, or the name might
-
not match the domain name in the URL).
-
If you'd like to turn off curl's verification of the certificate, use
-
the -k (or --insecure) option.
-
HTTPS-proxy has similar options --proxy-cacert and --proxy-insecure.
-
rustup: command failed: downloader https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup/dist/x86_64-apple-darwin/rustup-init /var/folders/j_/xj53k3kn3mxb_98p4681ypjh0000gn/T/tmp.NyQVPvg9/rustup-init x86_64-apple-darwin
其他下载安装方式
Other Installation Methods - Rust Forge
请下载对应版本进行安装,1.65.0大约是200M
Cargo:Rust 的构建工具和包管理器
您在安装 Rustup 时,也会安装 Rust 构建工具和包管理器的最新稳定版,即 Cargo。Cargo 可以做很多事情:
cargo build
可以构建项目cargo run
可以运行项目cargo test
可以测试项目cargo doc
可以为项目构建文档cargo publish
可以将库发布到 crates.io。
要检查您是否安装了 Rust 和 Cargo,可以在终端中运行:
cargo --version
Rust 支持多种编辑器
编写Hello_Rust.js
cargo new hello-rust
这会生成一个名为 hello-rust
的新目录,其中包含以下文件:
-
hello-rust
-
|- Cargo.toml
-
|- src
-
|- main.rs
Cargo.toml
为 Rust 的清单文件。其中包含了项目的元数据和依赖库。
src/main.rs
为编写应用代码的地方。
cargo new
会生成一个新的“Hello, world!”项目!我们可以进入新创建的目录中,执行下面的命令来运行此程序:
cargo run
Hello, world!
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhgaeacg
系列文章
更多
同类精品
更多
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
excel下划线不显示怎么办
PHP中文网 06-23 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
TikTok加速器哪个好免费的TK加速器推荐
TK小达人 10-01 -
怎样阻止微信小程序自动打开
PHP中文网 06-13