pub enum BoundedOption<T> {
Some(usize,T),
None(usize),
OutOfResource
}
impl<T> BoundedOption<T> {
pub fn unwrap(&self) -> &T {
match self {
BoundedOption::Some(_,item) => item,
_ => panic!("failed unwrapping")
}
}
}
pub trait BoundedIterator {
type Item;
fn next_for(&mut self, n: usize) -> BoundedOption<Self::Item>;
}