【Rust日报】 2020-06-12 了解 Fuchsia 的 Rust 开发

了解 Fuchsia 的 Rust 开发

Fuchsia 是 Google 正在开发的一个开源操作系统,最近 fuchsia.dev 上最近更新了很多开发文档,其中 Rust 开发文档最近于 2020-06-10 更新。在已经开放的开发文档里面,Rust 文档相对来说还是比较丰富的,相应的公开讨论频道在:[email protected]

了解更多详情或者查看文档请看:https://fuchsia.dev/fuchsia-src/development/languages/rust

reddit 上参与讨论:https://www.reddit.com/r/rust/comments/h7dkv2/rust_fuchsia/

GameLisp

GameLisp 是一个用于 Rust 游戏开发的脚本语言。了解详情请看:https://gamelisp.rs/

Shredder 项目

Shredder 项目主要针对于 Rust 的智能指针的“垃圾回收”,更多细节请看博客原文:https://blog.typingtheory.com/shredder-garbage-collection-as-a-library-for-rust/

项目地址:https://github.com/Others/shredder

derive_aktor

derive_aktor 是一个宏库,使用起来还是挺方便的,项目地址:https://github.com/insanitybit/derive_aktor

使用示例:

pub struct KeyValueStore    where U: Hash + Eq + Send + 'static{    inner_store: HashMap,    self_actor: Option>,}
impl KeyValueStore {    pub fn new() -> Self {        Self {            inner_store: HashMap::new(),            self_actor: None,        }    }}
// All methods in this block form our Actor's API#[derive_actor]impl KeyValueStore {    pub fn query(&self, key: U, f: Box) + Send + 'static>) {        println!("query");        f(self.inner_store.get(&key).map(String::from))    }
    pub fn set(&mut self, key: U, value: String) {        println!("set");        self.inner_store.insert(key, value);    }}

#[tokio::main]async fn main() {
    let (kv_store, handle) = KeyValueStoreActor::new(KeyValueStore::new()).await;        // We can use an async API that's typed and nominal    kv_store.query("foo", Box::new(|value| println!("before {:?}", value))).await;    kv_store.set("foo", "bar".to_owned()).await;    kv_store.query("foo", Box::new(|value| println!("after {:?}", value))).await;
    // We must drop any references to kv_store before we await the handle, or it will leak!
    drop(kv_store);    handle.await;}



From 日报小组 @Jancd

你可能感兴趣的:(【Rust日报】 2020-06-12 了解 Fuchsia 的 Rust 开发)