官术网_书友最值得收藏!

Sequence types in Rust

Sequences are supported in many forms in Rust. The regular array is strictly implemented: it has to be defined at compile time (using literals) and be of a single data type, and cannot change in size. Tuples can have members of different types, but cannot change in size either. Vec<T> is a generic sequence type (of whatever you define as type T) that provides dynamic resizing—but T can only be of a single type. All in all, each of them has its purpose and, in this recipe, we will explore each.  

主站蜘蛛池模板: 鄯善县| 武乡县| 南阳市| 东乡族自治县| 原平市| 鄱阳县| 深圳市| 什邡市| 巴楚县| 子洲县| 巴楚县| 蕲春县| 沙河市| 尼玛县| 五常市| 宝坻区| 富民县| 莱阳市| 闻喜县| 南乐县| 福海县| 昌都县| 容城县| 泰安市| 喜德县| 贡山| 朝阳市| 安丘市| 竹北市| 吉水县| 敦煌市| 辉南县| 平原县| 扶绥县| 盈江县| 溧阳市| 樟树市| 宜阳县| 中牟县| 台山市| 东阿县|