Struct pushgen::SliceGenerator[][src]

pub struct SliceGenerator<'a, T> { /* fields omitted */ }
Expand description

A generator that generates values from a slice.

Example

let data = [1, 2, 3, 4];
let mut sum = 0;
SliceGenerator::new(&data).for_each(|x| sum += x);
assert_eq!(sum, 10);

Implementations

Trait Implementations

Data-type generated by the generator.

Run the generator, emitting values to the output closure. New values are emitted for as long as the closure returns ValueResult::MoreValues. If the closure returns ValueResult::Stop the generator must return GeneratorResult::Stopped. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.