当前位置:网站首页>Rust 入门指南(crate 管理)
Rust 入门指南(crate 管理)
2022-07-28 14:50:00 【InfoQ】
- 搜索 crates
- 在项目中使用 crates
- 配置 crate
- 安装 / 使用 cargo-watch
Crates
$ cargo search sql
使用 Crates
$ cargo new {project_name}[package]
name = "hello_world"
version = "0.1.0"
edition = "2022"# See more keys and their definitions athttps://doc.rust-lang.org/cargo/reference/manifest.html[dependencies]
[package]
name = "hello_world"
version = "0.1.0"
edition = "2018"# See more keys and their definitions athttps://doc.rust-lang.org/cargo/reference/manifest.html[dependencies]
sql = "0.4.3" <-- Add dependency here
Crates、Git 和 Feature toggles
[dependencies]
bracket-lib = “~0.8.1”
[dependencies]
bracket-lib ={ git = "https://github.com/thebracket/bracket-lib" }
[dependencies]
bracket-lib = {
git = "https://github.com/thebracket/bracket-lib",
default-features = false,
features = [ "amethyst_engine_vulkan" ]
}
源(Source)和二进制 Crates
$ cargo buildCompiling sql v0.4.3
Compiling hello_world v0.1.0 (/Users/gian/hello_world)
Finished dev [unoptimized + debuginfo] target(s) in 0.99s
$ cargo install {crate_name}cargo installCargo-watch
cargo searchcargo installcargo installUpdating crates.io index
Ignored package `cargo-watch v7.8.1` is already installed, use --force to override
$ cargo install cargo-watch$ cargo-watch -x buildcargo build$ cargo-watch -x fmt -x test总结
边栏推荐
- Pytorch - optimize model parameters
- PyQt5快速开发与实战 5.1 表格与树
- Framework定制系列(一)-----SystemUI NavigationBar导航栏上滑返回Launcher
- File and directory operations (5)
- Several slips of X rust, those things that have to be said
- 一文了解 Rainbond 云原生应用管理平台
- 电压频率的变换原理
- Voice social system -- improve the audio system industry chain
- Using SYSTEMd to manage services
- Where is the RDS MySQL read-only instance of Alibaba cloud created
猜你喜欢

光学雨量计应用降雨量检测

编码器高速脉冲计数器Modbus RTU模块IBF150

开光量输入/继电器输出rs485/232远程数据采集IO模块IBF70

1路编码器2路DI转速测量RS485串口连接1路DO报警模块IBF151

活动速递| Apache Doris 性能优化实战系列直播课程初公开,诚邀您来参加!

5路DI/DO继电器输出远程IO采集模块Modbus TCP/IBF95

Principle and application of low cost / small volume module rs485/232 to analog signal ibf33

A tour of gRPC:05 - gRPC server straming 服务端流

Voice social system -- improve the audio system industry chain

MLX90640 红外热成像仪测温传感器模块开发笔记(八)
随机推荐
跟我学Rx编程——Concat
太阳能路灯的根本结构及作业原理
多用型混合信号8AI/4DI/DO转串口RS485/232MODBUS采集模块IBF30
Minimum heap improves the efficiency of each sort
高速计数器转RS485Modbus RTU模块IBF150
Software architecture and design (IV) -- data flow architecture
Learn about the native application management platform of rainbow cloud
About the pictures inserted in the word document, only the following part is displayed
String (3)
Samba Server Setup Guide
A tour of gRPC:05 - gRPC server straming 服务端流
热敏电阻PT100,NTC转0-10V/4-20mA转换器
Framework定制系列(六)-----屏蔽FallbackHome手机启动中弹窗直接进入Launcher
Software architecture and design (x) -- Architecture Technology
FTP file transfer protocol
Docker container implements MySQL master-slave replication
NTC,PT100热电阻转4-20mA温度信号转换器
Learn RX programming from me -- concat
多功能混合信号AI采集/开关量DI/DO采集转RS485/232/MODBUS模块
分体式测斜探头安装要点及注意事项