vec: add an external iterator
auto merge of #5923 : thestinger/rust/iterator, r=graydon