Trait extra::dlist::ListInsertion

pub trait ListInsertion<A> {
    fn insert_next(&mut self, elt: A);
    fn peek_next<'a>(&'a mut self) -> std::option::Option;
}

Allow mutating the DList while iterating

Required Methods

fn insert_next(&mut self, elt: A)

Insert elt just after to the element most recently returned by .next()

The inserted element does not appear in the iteration.

fn peek_next<'a>(&'a mut self) -> std::option::Option

Provide a reference to the next element, without changing the iterator

Implementors