mlua v0.4 发布并支持Lua 5.4
mlua v0.4 released with Lua 5.4 support https://github.com/khvzak/mlua
MiniCouchDB: implementing a subset of CouchDB in Rust
MiniCouchDB: implementing a subset of CouchDB in Rust https://www.garrensmith.com/blogs/mini-couch-hack-week https://github.com/garrensmith/couch_hack_week
Benchrs: Apache Benchmark(ab) clone in rust
Benchrs: Apache Benchmark(ab) clone in rust https://crates.io/crates/benchrs
Benchrs 0.1.7
Arkaitz Jimenez <arkaitzj@gmail.com>
Does http benchmarks
USAGE:
benchrs [FLAGS] [OPTIONS] <url>
FLAGS:
-h, --help Prints help information
-k Enables keep alive
-V, --version Prints version information
-v Increases verbosity
OPTIONS:
-c <concurrency> Sets the concurrency level
-H <header>... Sets a custom header
-m <method> Request method: default GET
-p <postfile> File attach as request body
-n <request number> Sets the number of requests
ARGS:
<url> The url to hit
Rust/WinRT快速入门
Getting started with Rust/WinRT https://kennykerr.ca/2020/06/05/getting-started-with-rust-winrt/
-
GitHub: https://github.com/microsoft/winrt-rs -
Docs.rs: https://docs.rs/winrt/ -
Crates.io: https://crates.io/crates/winrt
-
Visual Studio 2019 – be sure to install the C++ tools as this is required by the Rust compiler (only the linker is required). -
Visual Studio Code – this is the default IDE used for Rust. -
Python – be sure to install the x64 version as this is required for debugging support. -
Git – Rust has deep support for Git. -
Rust – this installs rustup
which is a tool for installing Rust toolchains and common Rust related tooling.
Ctrl+Shift+X
打开扩展页安装下面的extensions:
-
rust-analyzer – there are others, but this is the only Rust extension that I’ve tried that actually works reliably most of the time. -
CodeLLDB – you can also use the Microsoft C++ extension for debugging, but this one does a better job of integrating with the IDE. -
C/C++ – the Microsoft C++ extension doesn’t integrate as well with the IDE, but provides superior debugging information, so you may want to have that on hand for an emergency.
C:\>cargo new sample
Created binary (application) `sample` package
C:\>cd sample
C:\sample>code .
[dependencies]
winrt = "0.7.0"
C:\sample>cargo build
Updating crates.io index
Compiling proc-macro2 v1.0.18
Compiling unicode-xid v0.2.0
...
Compiling winrt_gen_macros v0.7.0
Compiling winrt_gen v0.7.0
Compiling winrt_macros v0.7.0
Compiling winrt v0.7.0
Compiling sample v0.1.0 (C:\sample)
Finished dev [unoptimized + debuginfo] target(s) in 19.65s
C:\sample>cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
Running `target\debug\sample.exe`
Hello, world!
winrt::import!(
dependencies
os
types
windows::data::xml::dom::*
);
os
表示需要运行的操作系统,也可以指定特定版本的Windows SDK。然后指定了官方文档中的一些类型
windows::data::xml::dom
下面还有用了
XmlDocument
,具体的细节可以参考
官方文档
:
fn main() -> winrt::Result<()> {
use windows::data::xml::dom::*;
let doc = XmlDocument::new()?;
doc.load_xml("<html>hello world</html>")?;
let root = doc.document_element()?;
assert!(root.node_name()? == "html");
assert!(root.inner_text()? == "hello world");
Ok(())
}
C:\sample>cargo run
Compiling sample v0.1.0 (C:\sample)
Finished dev [unoptimized + debuginfo] target(s) in 8.71s
Running `target\debug\sample.exe`
Windows API
了。
rust语言写斗兽棋游戏
Animal Fight Chess Game written in rust. https://github.com/netcan/AnimalChess
-
http://ancientchess.com/page/play-doushouqi.htm -
https://en.wikipedia.org/wiki/Jungle_(board_game)
git clone https://github.com/netcan/AnimalChess.git
cd AnimalChess
cargo run --release
本文分享自微信公众号 - Rust语言中文社区(rust-china)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。
来源:oschina
链接:https://my.oschina.net/u/4581704/blog/4375577