Created
October 13, 2015 10:35
-
-
Save hyunsik/d4a8743bf6b5bf1ea7a4 to your computer and use it in GitHub Desktop.
Skeleton Code for Rust Iterator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct TaskSet; | |
pub struct TaskSetIterator { | |
... | |
} | |
impl Iterator for TaskSetIterator { | |
type Item = Task; | |
fn next(&mut self) -> Option<Task> { | |
.... | |
} | |
} | |
pub struct Task; | |
impl IntoIterator for TaskSet { | |
type Item = Task; | |
type IntoIter = TaskSetIterator; | |
fn into_iter(self) -> Self::IntoIter { | |
TaskSetIterator { ... } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment