摘要:win10 +nightly 之前写rust代码一直没问题。 由于需要用https://crates.io/crates/iconv库,结果出现了: rust error: linking with `link.exe` failed: exit code: 1181(省略... ...) = no
阅读全文
摘要:src/main.rs use std::fs; use std::io::prelude::*; use std::net::TcpListener; use std::net::TcpStream; fn main() { // Listen for incoming TCP connectio
阅读全文
摘要:根据 Asynchronous Programming in Rust (https://rust-lang.github.io/async-book/01_getting_started/04_async_await_primer.html) 整理的代码: use futures::executo
阅读全文
摘要:在子线程中,写成这样就不提示溢出了 use std::thread; use std::time::Duration; fn main() { let handle = thread::Builder::new().stack_size(2 * 1024 * 1024 * 1024 ).spawn(
阅读全文
摘要:参考:https://www.cntofu.com/book/192/src/ch14-03-cargo-workspaces.md 要点: 1、在目录名为add的根目录(或者叫workspaces)下的Cargo.toml,称为顶级Cargo.toml 其中[workspace]字段指明了工作空间
阅读全文
摘要:win10系统 Cargo.toml [dependencies] windows = "0.19" encoding = "0.2" [build-dependencies] windows = "0.19" main.rs mod bindings { windows::include_bind
阅读全文
摘要:1 Cargo.toml [package] name = "hellowinapi" version = "0.1.0" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/carg
阅读全文
摘要:1 执行 cargo new hellolib --lib 创建库项目 修改 cargo.toml [lib] name = "myfirst_rust_dll" #生成dll的文件名 crate-type = ["dylib"] lib.rs #[no_mangle] pub extern fn
阅读全文
摘要:手机抄代码都费劲,一是用firefox登不上博客园,因为光标定位在密码框中时弹不出手机键盘,换uc好了。二是比如输入大括号时,手机总自做聪明地错误添加或删除成对的括号(这个可以修改输入法设置)。要感谢rust playground和uc,让我们在手机上也能调试代码。 所谓高阶函数,就是函数中可以传入
阅读全文