vector in Rust 1 2 3 4 5 struct Vec { length: u32, //Present size of vector ptr: RefCell, //Pointer to allocate Memory on Heap capacity: u32, //Max size vector can hold, after this vector need to be resized/reallocated } create 不指定数据类型 1 2 let mut v1 = Vec::new(); let mut v2 = vec![]; 指定数据类型 1 2 3 let