摘要:
资源:内存区块。不同的内存区块位置和大小就是不同的资源。 str let a = "xxx".to_string(); 含义:a绑定到字符串资源A上,拥有资源A的所有权 let mut a = "xxx".to_string(); 含义:a绑定到字符串资源A上,拥有资源A的所有权,同时a还可绑定到新 阅读全文
摘要:
src/main.rs #[derive(Debug)] enum List { Cons(Rc<RefCell<i32>>, Rc<List>), Nil, } use crate::List::{Cons, Nil}; use std::borrow::BorrowMut; use std::c 阅读全文