Trait ListTypeIteratorAdvance
pub trait ListTypeIteratorAdvance<P>: Sized + Listwhere
P: ListTypeProperty,{
// 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,
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>,
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,
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 ()where
P: ListTypeProperty,
impl<P> ListTypeIteratorAdvance<P> for ()where
P: ListTypeProperty,
§fn advancer<R>(
_iter: &mut ListTypeIterator<R, P>,
) -> Option<<P as ListTypeProperty>::Output>where
R: List,
fn advancer<R>(
_iter: &mut ListTypeIterator<R, P>,
) -> Option<<P as ListTypeProperty>::Output>where
R: List,
Reports exhaustion without generating a head property.