Skip to content

Instantly share code, notes, and snippets.

@hyunsik

hyunsik/task.rs

Created Oct 13, 2015
Embed
What would you like to do?
Skeleton Code for Rust Iterator
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
You can’t perform that action at this time.