Skip to main content

ListTypeIteratorAdvance

Trait ListTypeIteratorAdvance 

pub trait ListTypeIteratorAdvance<P>: Sized + List{
    // Required method
    fn advancer<R>(
        iter: &mut ListTypeIterator<R, P>,
    ) -> Option<<P as ListTypeProperty>::Output>
       where R: List;
}
Expand description

Advance function provider used by ListTypeIterator.

Implementations advance to the next tail before returning a head property, and return None at an empty tail.

§Examples

See ListTypeIterator.

Required Methods§

fn advancer<R>( iter: &mut ListTypeIterator<R, P>, ) -> Option<<P as ListTypeProperty>::Output>
where R: List,

Advances the iterator and returns the next property, or None at exhaustion.

  • Complexity: The property generator’s complexity for a nonempty head.
§Examples

See ListTypeIterator.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl<P, H, T> ListTypeIteratorAdvance<P> for (H, T)
where P: ListTypeProperty, H: 'static, T: ListTypeIteratorAdvance<P>,

§

fn advancer<R>( iter: &mut ListTypeIterator<R, P>, ) -> Option<<P as ListTypeProperty>::Output>
where R: List,

Generates the current head property and advances to the tail.

  • Complexity: The property generator’s complexity.
§

impl<P> ListTypeIteratorAdvance<P> for ()

§

fn advancer<R>( _iter: &mut ListTypeIterator<R, P>, ) -> Option<<P as ListTypeProperty>::Output>
where R: List,

Reports exhaustion without generating a head property.

Implementors§