当前位置 : 主页 > 编程语言 > java >

【Rust日报】2019-12-02 - RustFest Barcelona 2019 所有录像已经可以下载了

来源:互联网 收集:自由互联 发布时间:2022-06-30
RustFest Barcelona 2019 所有录像已经可以下载了 现在官方已在Youtube上提供下载 Youtube: ​​https://www.youtube.com/watch?v=o01QmYVluSwlist=PL85XCvVPmGQg-dewHRpM08JkGrBPdIVHwindex=2t=0s​​ diesel-cli、cargo-tree和

RustFest Barcelona 2019 所有录像已经可以下载了

现在官方已在Youtube上提供下载

Youtube:​​https://www.youtube.com/watch?v=o01QmYVluSw&list=PL85XCvVPmGQg-dewHRpM08JkGrBPdIVHw&index=2&t=0s​​

diesel-cli、cargo-tree和cargo已经被打包到了Arch Linux中

Package Repo:​​https://www.archlinux.org/packages/community/x86_64/diesel-cli/​​

How to RiiR

In a previous article we’ve talked about how you can avoid rewriting a library in Rust when you don’t need to. But what about the times when you really do need to?In most languages you’d need to rewrite the entire library from the ground up, waiting until the port is almost finished before you can start seeing results. These sorts of ports tend to be quite expensive and error-prone, and often they’ll fail midway and you’ll have nothing to show for your effort. Joel Spolsky does a much better job of explaining this than I ever could, see his article on why full rewrites are a bad idea for more.However, Rust has a killer feature when it comes to this sort of thing. It can call into C code with no overhead (i.e. the runtime doesn’t need to inject automatic marshalling like C#’s P/Invoke) and it can expose functions which can be consumed by C just like any other C function. This opens the door for an alternative approach:Port the library to Rust one function at a time.

Read More:​​http://adventures.michaelfbryan.com/posts/how-to-riir/index.html​​

Rust async-std的简单例子

As everyone knows, Rust recently stabilized the async/await feature. My first attempt to convert a little program I had to use it was a dismal failure, (reasons are at the bottom of this post), so I thought I would step back and write some simple - and I do mean very simple - examples of how to use await. The final step in this post shows how to download multiple URLs, in parallel, which was the business problem I was trying to solve in the first place.I am definitely a learner when it comes to this material, so there may well be better ways to accomplish some of this - if so, please write a comment and I’ll update the post.

Read More:​​https://www.philipdaniels.com/blog/2019/async-std-demo1/​​

异步在async-std中是如何工作的

Lately I was porting a software from tokio/futures-1.0 to async-await. I somehow thought async-std was the successor of tokio and ported everything to async-std. 80% in, I noticed that my hyper dependency requires tokio and that it's not possible to replace tokio with async-std without also replacing hyper. Also, tokio and async-std try to solve the same problem. So I started a journey into the inners of the rust async story to find out if it is possible to use both tokio and async-std at the same time. (tl;dr: it is). I had heard of reactors and executors before, but there was much new stuff to discover.I found it interesting, so I decided to write it down. The following is a dive into a mixture of async-std-1.0.1 and async-std-master. I guess that tokio does not differ that much in its architectural design. I will skip async-await sugar, Pin and futures. Disclaimer: There may be misconceptions in here.

Read More:​​https://gist.github.com/Phaiax/dd3476f13b4542492f79e3ab2171eb8c​​


日报订阅地址:

独立日报订阅地址:

  • Telgram Channel
  • 阿里云语雀订阅
  • Steemit
  • GitHub

社区学习交流平台订阅:

  • Rust.cc 论坛: 支持 rss
  • Rust Force: 支持 rss
  • 微信公众号:Rust 语言学习交流


【转自:美国高防站群服务器 http://www.558idc.com/mggfzq.html 复制请保留原URL】
上一篇:Tokio 和 Async IO 到底都是些啥玩意?
下一篇:没有了
网友评论