0
点赞
收藏
分享

微信扫一扫

【Rust日报】2020-02-06 那些在生产中使用 Rust 的公司

栖桐 2022-06-27 阅读 30

那些在生产中使用 Rust 的公司

按行业组织的,在生产中使用 Rust 的公司的精选列表。可供大家参考,GitHub 地址:​​https://github.com/omarabid/rust-companies​​

reddit 上参与讨论:​​https://www.reddit.com/r/rust/comments/ez7m4u/rust_companies_in_production_list_feel_free_to/​​

Async Diesel

这个仓库简洁、有效地将 Diesel 集成到 async-std 中,如果你用 Rust 构建后端程序的时候想使用数据库连接池,可以考虑这种方式。

使用示例:

#[macro_use]
extern crate diesel;

use async_diesel::*;
use diesel::{
prelude::*,
r2d2::{ConnectionManager, Pool},
};
use std::error::Error;
use uuid::Uuid;

// Schema
table! {
users (id) {
id -> Uuid,
}
}

#[async_std::main]
async fn main() -> Result<(), Box<dyn Error>> {
// Connect
let manager =
ConnectionManager::<PgConnection>::new("postgres://postgres@localhost/async_diesel__test");
let pool = Pool::builder().build(manager)?;

// Add
println!("add a user");
diesel::insert_into(users::table)
.values(users::id.eq(Uuid::new_v4()))
.execute_async(&pool)
.await?;

// Count
let num_users: i64 = users::table.count().get_result_async(&pool).await?;
println!("now there are {:?} users", num_users);

Ok(())
}

项目地址:​​https://github.com/mehcode/async-diesel​​

​Strings​ in Rust and WebAssembly

如标题所说,我们将讨论 WebAssembly(Wasm)中的 String,说明 Rust 的 String 是如何运作的。并且使用 Wasm-pack 来构建 HelloWorld 程序。原文地址:​​https://medium.com/wasm/strings-in-webassembly-wasm-57a05c1ea333​​

reddit 上参与讨论:​​https://www.reddit.com/r/rust/comments/ezbebl/strings_in_rust_and_webassembly/​​

Cross Compiling Rust for the Raspberry Pi

This guide covers how to set up your linux computer to compileupload, and run a Rust binary on your Raspberry Pi.

read more:https://chacin.dev/blog/cross-compiling-rust-for-the-raspberry-pi/


举报

相关推荐

0 条评论