2020年2月19日

C#调用rust编写的dll

摘要: 通过 cargo new --lib add 创建 rust 库项目 lib.rs #[no_mangle] pub extern fn add(a: i32, b: i32) -> i32 { a + b } cargo.toml 增加 dll 配置 [lib]name="addlist"crat 阅读全文

posted @ 2020-02-19 11:26 阿水 阅读(196) 评论(1) 推荐(0) 编辑

对rust生命周期的理解

摘要: 第一段示例代码 fn main() { let mut l: &str; let str1 = String::from("abc"); { let str2 = String::from("1234"); l = longest(str1.as_str(), str2.as_str()); } p 阅读全文

posted @ 2020-02-19 10:35 阿水 阅读(922) 评论(0) 推荐(0) 编辑

导航