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

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.  

主站蜘蛛池模板: 年辖:市辖区| 茂名市| 绥滨县| 麻阳| 尚志市| 建始县| 新干县| 淮南市| 泰来县| 子洲县| 兴山县| 云霄县| 宣化县| 麟游县| 肇庆市| 微博| 博罗县| 仲巴县| 囊谦县| 谷城县| 景泰县| 通山县| 辽宁省| 阳春市| 红桥区| 晋江市| 桂平市| 深州市| 仙游县| 筠连县| 南涧| 合肥市| 盐城市| 海南省| 张家川| 屯门区| 富裕县| 齐齐哈尔市| 封开县| 江达县| 白玉县|