Re:Rust Ownership Explained with Python
by marcianx on Sunday September 30, 2018 @12:33AM
(#18104470)
Rust does have these abstractions. The corresponding rust traits are `IntoIterator<Item=T>` and `Iterator<Item=T>`. For example:
and consequently,
[ Parent
| on HN ]
Re:Rust Ownership Explained with Python
by lostmsu on Sunday September 30, 2018 @01:10AM
(#18104570)
Good, but how do you create something, that is IntoIterator, which holds an immutable description of how to generate members to iterate over? And I mean some potentially infinite sequence.
Re:Rust Ownership Explained with Python
by heinrich5991 on Sunday September 30, 2018 @02:16AM
(#18104781)
For example like this: https://doc.rust-lang.org/std/iter/fn.repeat.html
Re:Rust Ownership Explained with Python
by lostmsu on Sunday September 30, 2018 @01:33PM
(#18107195)
Can you .map it?