iterator: add a FromIterator trait

This is able to take advantage of the lower bound from the size hint.