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

Implementing custom iterators

The true power of a great language is the way in which it lets the programmer integrate with types in the standard library and around the general ecosystem. One way to do this is the iterator pattern: defined by the Gang of Four in their book Design Patterns (Addison-Wesley Professional, 1994), an iterator is an encapsulation of a pointer moving through a collection. Rust provides a range of implementations on top of the Iterator trait. Let's see how we can leverage that power with only a few lines of code.

主站蜘蛛池模板: 霍山县| 晋中市| 临猗县| 陇川县| 巴林右旗| 海宁市| 锡林郭勒盟| 雅江县| 庄浪县| 昌黎县| 太保市| 海晏县| 罗源县| 奉贤区| 卢龙县| 兴仁县| 吴川市| 甘南县| 塘沽区| 伊吾县| 新邵县| 长海县| 峨山| 凤凰县| 化隆| 海阳市| 皋兰县| 合水县| 常山县| 尼木县| 东兰县| 元朗区| 天峨县| 道真| 海林市| 勐海县| 桦川县| 缙云县| 安徽省| 黑水县| 九龙城区|