blog icon indicating copy to clipboard operation
blog copied to clipboard

Rust: Pro

Open hhstore opened this issue 2 years ago • 6 comments

related:

  • [x] #342
  • [x] #347

hhstore avatar Feb 21 '22 09:02 hhstore

Rust 进阶部分:

  • https://rustwiki.org/

Rust 硬核劝退篇:

  • https://coolshell.cn/articles/20845.html
    • ⭐⭐⭐⭐
    • 皓哥 带你踩坑 rust.
    • 踩坑: rust 设计有缺陷 & 不一致的地方.
image

Rust 标准库:

Rust 宏:

  • Rust 宏小册
    • https://rustcc.cn/article?id=ca15612f-b3ee-4cc7-85e0-193a6ed4fad3
    • https://danielkeep.github.io/tlborm/book/index.html
  • https://doc.rust-lang.org/book/ch19-06-macros.html

Rust 算法:

  • https://github.com/inrust/Rust-Programming-in-Action

用 Rust 写 OS:

hhstore avatar Feb 21 '22 09:02 hhstore

Rust FAQ:

Rust Context?

  • https://www.reddit.com/r/rust/comments/j4xx7i/what_is_the_rust_story_for_a_package_like_gos/
  • rust中有没有类似golang中的context的功能?
  • https://medium.com/@polyglot_factotum/rust-concurrency-patterns-no-context-no-cancel-no-leak-b6c1ec2dafa5
  • https://github.com/webrtc-rs/webrtc/issues/57

tokio 等价概念:

  • https://docs.rs/tokio/0.2.22/tokio/time/fn.timeout.html
use tokio::time::timeout;
use tokio::sync::oneshot;

use std::time::Duration;

let (tx, rx) = oneshot::channel();

// Wrap the future with a `Timeout` set to expire in 10 milliseconds.
if let Err(_) = timeout(Duration::from_millis(10), rx).await {
    println!("did not receive value within 10 ms");
}

搜索:

  • https://crates.io/search?q=context

tokio-context

  • https://github.com/PrismaPhonic/tokio-context

Rust App Global Context:

  • 类似全局变量概念
  • https://stackoverflow.com/questions/19605132/is-it-possible-to-use-global-variables-in-rust
  • https://users.rust-lang.org/t/a-guide-to-global-data-in-rust/42574
  • https://stackoverflow.com/questions/70293644/how-to-use-shared-variables-rusts-rocket-web-framework
  • https://haibane-tenshi.github.io/rust-contexts/
  • https://github.com/matklad/once_cell
  • https://github.com/vorner/arc-swap

rocket:

  • https://github.com/SergioBenitez/Rocket
  • https://rocket.rs/v0.5-rc/guide/state/#state
  • https://api.rocket.rs/v0.4/rocket/struct.State.html

hhstore avatar Feb 21 '22 10:02 hhstore

Rust 过程宏:

  • https://rustwiki.org/zh-CN/reference/procedural-macros.html
  • https://zhuanlan.zhihu.com/p/342408254

陈天视频讲解:

视频:

  • ✅【Rust 过程宏(第一弹)】 https://www.bilibili.com/video/BV1Za411q7LQ
    • 陈天
    • https://space.bilibili.com/39222989/channel/collectiondetail?sid=194028
    • 源码: https://github.com/tyrchen/geektime-rust/tree/master/47_48_macros

依赖库:

  • ✅ https://github.com/djc/askama
    • jinja2 模板

hhstore avatar Feb 21 '22 10:02 hhstore

1

hhstore avatar Feb 21 '22 10:02 hhstore

1

hhstore avatar Feb 21 '22 10:02 hhstore

1

hhstore avatar Feb 21 '22 10:02 hhstore