04 2023 档案
摘要:一、线程间通信方式: channel 1 use std::sync::mpsc; 2 use std::thread; 3 4 fn main() { 5 let (tx, rx) = mpsc::channel(); 6 7 thread::spawn(move || { 8 let val =
阅读全文
摘要:rust中智能指针大致分类 以下内容提炼自rust官方文档: https://doc.rust-lang.org/book/ch15-01-box.html 一、 Box<T> 1. 使用例子: 1 fn main() { 2 let b = Box::new(5); 3 println!("b =
阅读全文