前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【Rust日报】2020-07-20 boids算法, tide, popol, Calcite

【Rust日报】2020-07-20 boids算法, tide, popol, Calcite

作者头像
MikeLoveRust
发布2020-07-21 15:01:58
4020
发布2020-07-21 15:01:58
举报
文章被收录于专栏:Rust语言学习交流

文章类

Rust 模块系统的超清晰解释

Rust 的模块系统可能对于新人来说有些困惑,这篇文章通过几个循序渐进的小例子,让你快速且清晰的对 Rust 模块系统有一个基本的认识.

http://www.sheshbabu.com/posts/rust-module-system/

使用 Rust 实现 boids 算法 (Game)

这是 Rust 来实现经典的 Boids 算法的一系列文章的 Part1. 做游戏或者对该算法感兴趣,并且希望来学习 Rust 的同学也可以参考一下.有比较详细的过程和代码.

https://blog.bitsacm.in/a-fistful-of-boids/ 关于Boids: http://www.red3d.com/cwr/boids/

Rate Limiting in Rust Using Redis

使用 Redis 来实现 Rate limit.

https://outcrawl.com/rust-redis-rate-limiting

Crates

Native-Windows-GUI 发布 1.0 stable 版本

Native-Windows-Gui (NWG) 一个基于 win32 的 rust 库. 号称在 Windows 平台下开发 native GUID 最好且唯一的 Rust 库.

此外,还有一个发布一个姐妹库 Native-Windows-Derive, 可以让开发者使用 Macro 来快速构建 GUI.

https://github.com/gabdube/native-windows-gui 以及 https://gabdube.github.io/native-windows-gui/native-windows-docs/index.html

popol 更小的基于 poll 的 non-blocking IO 库

一个基于 poll 的最小 non-blocking IO 库. 作者设计的初衷是为了解决 peer-to-peer networking 中大量连接的管理问题. 作者不需要一个拥有大量依赖和复杂特性的 async/await runtime, 仅仅需要一个 non-bloking IO 库.

  • mio 更小 ( mio 的 10% 大小)
  • 而且所有的 Rust 标准库可以正常工作(例如 io::Read, io::Write)
  • 仅依赖libc
  • 没有 "runtime"

https://github.com/cloudhead/popol

Calcite 用于创建deno plugins的库

https://github.com/Srinivasa314/calcite/blob/master/docs/part1.md

例子:

代码语言:javascript
复制
cargo build --example sync
deno run --unstable --allow-plugin --allow-read --allow-write examples/sync.ts
cargo build --example async
deno run --unstable --allow-plugin --allow-read --allow-write examples/async.ts

https://github.com/Srinivasa314/calcite

tide 发布 v0.12.0

主要变动:

  1. 新增 ResponseBuilder 更加方便的构建 Response. app.at("/").get(|_| async { let res = Response::builder(203) .body(json!({ "hello": "cats!" })) .header("X-Nori", "me-ow") .header("X-Chashu", "meewwww"); Ok(res) })
  2. Server::listen 通过引入新的 Listener trait, 可以提供各种 transport, 默认内置对了 TcpStream,SocketAddrUnixStream的实现. let mut app = tide::new(); let listener = TlsListener::build() .addrs("localhost:4433") .cert(cert) .key(key); app.listen(listener).await?;
  3. 此外,同时发布的还有 tide::listener::ConcurrentListener,用于处理多个 transports,例如开发者想同时处理 IPV4 和 IPV6. let mut app = tide::new(); let mut listener = listener::ConcurrentListener::new(); listener.add((Ipv4Addr::new(127, 0, 0, 1), 8000)); listener.add((Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8000)); app.listen(listener).await?;
  4. State现在必须要 clone.
  5. 迁移所有的 trait 使用 async-trait.
  6. middleware 中错误处理的改进.

https://github.com/http-rs/tide/releases/tag/v0.12.0

From 日报小组 FBI小白,BobQ

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

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

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

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

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 文章类
    • Rust 模块系统的超清晰解释
      • 使用 Rust 实现 boids 算法 (Game)
        • Rate Limiting in Rust Using Redis
        • Crates
          • Native-Windows-GUI 发布 1.0 stable 版本
            • popol 更小的基于 poll 的 non-blocking IO 库
              • Calcite 用于创建deno plugins的库
                • tide 发布 v0.12.0
                相关产品与服务
                云数据库 Redis
                腾讯云数据库 Redis(TencentDB for Redis)是腾讯云打造的兼容 Redis 协议的缓存和存储服务。丰富的数据结构能帮助您完成不同类型的业务场景开发。支持主从热备,提供自动容灾切换、数据备份、故障迁移、实例监控、在线扩容、数据回档等全套的数据库服务。
                领券
                问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档