[][src]Struct rc_dlist_deque::dlist::ListIterator

pub struct ListIterator<N, S: Selector<Node = N>>(_);

Iterator (forwards) through the list.

Care must be taken if the list is modified while the iterator exists: the iterator keeps a reference to the next item to be returned. If that item is removed from the list, and maybe put onto some other list, the iterator will continue with that item, and, thereeafter, whatever its successors are on whatever list it ends up on.

However, a consequece is: it does work to iterate over a list, sometimes removing the item returned by the iterator. Also, modification of the list while it is being iterated over will not lead to panics, or undefined behaviour --- only possible unexpected results.

(This is actually a wrapper around a Cursor: pointing to the next element to be returned, or None.)

Methods

impl<N, S: Selector<Node = N>> ListIterator<N, S>[src]

pub fn walk(&mut self, rev: bool)[src]

Moves the iterator one step. If the iterator has already reached the end, is a no-op. If the iterator's next pointer points at a node which is not in any list, walk will report that node and leave the iterator finished.

pub fn next_prev(&mut self, rev: bool) -> Cursor<N, S>[src]

Returns the current node (the next node to be returned), if any, and then advances (or retards) the iterator.

pub fn cursor(&self) -> Cursor<N, S>[src]

pub fn from_cursor(c: Cursor<N, S>) -> Self[src]

Trait Implementations

impl<N, S: Selector<Node = N>> Deref for ListIterator<N, S>[src]

type Target = Cursor<N, S>

The resulting type after dereferencing.

impl<N, S: Selector<Node = N>> DerefMut for ListIterator<N, S>[src]

impl<N, S: Selector<Node = N>> FusedIterator for ListIterator<N, S>[src]

impl<N, S: Selector<Node = N>> Iterator for ListIterator<N, S>[src]

type Item = Pointer<N, S>

The type of the elements being iterated over.

Auto Trait Implementations

impl<N, S> !RefUnwindSafe for ListIterator<N, S>

impl<N, S> !Send for ListIterator<N, S>

impl<N, S> !Sync for ListIterator<N, S>

impl<N, S> Unpin for ListIterator<N, S> where
    S: Unpin

impl<N, S> UnwindSafe for ListIterator<N, S> where
    N: RefUnwindSafe,
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.