Trait heron::rapier_plugin::rapier::rayon::iter::plumbing::Folder[][src]

pub trait Folder<Item> {
    type Result;
    pub fn consume(self, item: Item) -> Self;
pub fn complete(self) -> Self::Result;
pub fn full(&self) -> bool; pub fn consume_iter<I>(self, iter: I) -> Self
    where
        I: IntoIterator<Item = Item>
, { ... } }

The Folder trait encapsulates the standard fold operation. It can be fed many items using the consume method. At the end, once all items have been consumed, it can then be converted (using complete) into a final value.

Associated Types

type Result[src]

The type of result that will ultimately be produced by the folder.

Loading content...

Required methods

pub fn consume(self, item: Item) -> Self[src]

Consume next item and return new sequential state.

pub fn complete(self) -> Self::Result[src]

Finish consuming items, produce final result.

pub fn full(&self) -> bool[src]

Hint whether this Folder would like to stop processing further items, e.g. if a search has been completed.

Loading content...

Provided methods

pub fn consume_iter<I>(self, iter: I) -> Self where
    I: IntoIterator<Item = Item>, 
[src]

Consume items from the iterator until full, and return new sequential state.

This method is optional. The default simply iterates over iter, invoking consume and checking after each iteration whether full returns false.

The main reason to override it is if you can provide a more specialized, efficient implementation.

Loading content...

Implementors

Loading content...