【Rust日报】2022-06-27 Rust 中使用 wasm 来执行 OPA 策略

2022年6月27日 220点热度 0人点赞 0条评论

Rust 中使用 wasm 来执行 OPA 策略

开放策略代理(Open Policy Agent, OPA)是一种开源的通用策略引擎,它支持跨整个环境中执行统一的上下文感知策略. OPA 是 云原生计算基金会(CNCF)的一个毕业项目。
本文介绍了如何在 Rust 中使用 wasm 来执行 OPA 的策略.
原文链接:https://inspektor.cloud/blog/evaluating-open-policy-agent-in-rust-using-wasm/

keypath: Rust中的 keypath 实现

这是在 Rust 中实现 swift 风格keypath的早期实验. 可以实现对任意嵌套字段的强类型引用. 目前它只是一个概念验证. 示例代码如下.
#[derive(Keyable)]struct Person {
name: String,
friends: Vec<String>,
size: Size,
}#[derive(Keyable)]struct Size {
big: bool,
heft: u8,
}let mut person = Person {
name: "coco".into(),
friends: vec!["eli".into(), "nico".into(), "yaya".into()],
size: Size { big: false, heft: 45 }
};let first_friend: KeyPath<Person, String> = keypath!(Person.friends[0]);let heft = keypath!(Person.size.heft);assert_eq!(person[&first_friend], "eli");// mutation:person[&heft] = 101;assert_eq!(person.size.heft, 101);
原文链接:http://www.cmyr.net/blog/keypaths.html
keypath github 地址:https://github.com/cmyr/keypath

<<Rust 从零到生产>> 笔记

作者买了 Palmieri 的 <<Rust 从零到生产>> 这本书, 本文是学习笔记分享, 也算是对于该书的点评.
原文链接:https://bitemyapp.com/blog/notes-on-zero2prod-rust/

generational-lru: 一个新的 LRU 实现

基于 generational arena 实现的 LRU 实现.
原文链接:https://github.com/arindas/generational-lru

Rust 中的 Rc和 RefCell

一个介绍 Rc 和 RefCell 的视频,需要科学上网.
油管视频:https://www.youtube.com/watch?v=KYJ95TxEC18
--
From 日报小组 BobQin,FBI小白
社区学习交流平台订阅:
  • Rustcc论坛: 支持rss
  • 微信公众号:Rust语言中文社区

41920【Rust日报】2022-06-27 Rust 中使用 wasm 来执行 OPA 策略

这个人很懒,什么都没留下

文章评论