ITPub博客

首页 > 数据库 > 数据库开发技术 > 【Rust日报】 2020-02-13 在 VSCode 中调试 Rust 程序

【Rust日报】 2020-02-13 在 VSCode 中调试 Rust 程序

原创 数据库开发技术 作者:Rust语言中文社区 时间:2020-02-14 13:45:06 0 删除 编辑

Boa

它是用 Rust 编写的实验性 Javascript 词法分析器,解析器和编译器。

示例:

项目地址:https://github.com/jasonwilliams/boa

在 VSCode 中调试 Rust 程序

作者的这个博文基于上文提到的 Boa 项目。我们可以有多种方法调试 Boa 的操作,以此去了解它是如何工作的,甚至测试一些 javaScript 的代码。

了解具体的配置方法以及具体实现请看 博文地址:https://jason-williams.co.uk/debugging-rust-in-vscode

git-trim

git-trim 是 Rust 编写的项目,他可以自动修剪合并或消失的 git 远程跟踪分支。

仓库地址:https://github.com/foriequal0/git-trim

关于 Rust 并行编程的讨论

水友请看:https://www.reddit.com/r/rust/comments/f2uqa7/parallel_programming_in_rust/

麻辣火锅-DB???

当然,标题是开玩笑的orz,实际上这个项目是 hotpot-db,它是围绕 SQLite 的 JSON 扩展的 API,它使您能够以 NoSQL 的方式(像DynamoDB这样)存储数据。

使用示例:

use hotpot_db::*;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
struct Person {
name: String,
age: u8,
}

fn main() -> Result<(), hotpot_db::Error> {
let mut pot = HotPot::new();

// lets make a new collection
pot.create_collection("address_book")?;

// well make a new item we want to store
let person = Person {
name: String::from("david holtz"),
age: 26,
};

// we insert the object into the collection!
pot.insert::<Person>("address_book", &person)?;

// before we query we can add an index to speed things up
pot.add_index_to_collection("address_book", "name", "naming_index")?;

// finally we can query
let query = QueryBuilder::new()
.collection("address_book")
.kind(QueryKind::Object)
.key("name")
.comparison("=")
.string("david holtz")
.finish();

let results = pot.execute(query);
println!("{:#?}", results);

Ok(())
}

项目地址:https://github.com/drbh/hotpot-db

reddit 上参与讨论:https://www.reddit.com/r/rust/comments/f2vbji/github_drbhhotpotdb_hottest_way_to_store_data_on/


From 日报小组 @Jancd


原文作者:Rust语言中文社区;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论

注册时间:2020-06-11

  • 博文量
    1769
  • 访问量
    718639