前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【Rust日报】2020-02-06 那些在生产中使用 Rust 的公司

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

作者头像
MikeLoveRust
发布2020-02-20 10:48:23
5470
发布2020-02-20 10:48:23
举报
文章被收录于专栏:Rust语言学习交流

那些在生产中使用 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 构建后端程序的时候想使用数据库连接池,可以考虑这种方式。

使用示例:

代码语言:javascript
复制
  
#[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 compile, upload, and run a Rust binary on your Raspberry Pi.

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

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2020-02-07,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Rust语言学习交流 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 那些在生产中使用 Rust 的公司
  • Async Diesel
  • Strings in Rust and WebAssembly
  • Cross Compiling Rust for the Raspberry Pi
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档