Trait frunk_core::coproduct::CoproductFoldable[][src]

pub trait CoproductFoldable<Folder, Output> {
    fn fold(self, f: Folder) -> Output;
Expand description

Trait for folding a coproduct into a single value.

This trait is part of the implementation of the inherent method Coproduct::fold. Please see that method for more information.

You only need to import this trait when working with generic Coproducts or Folders of unknown type. If the type of everything is known, then co.fold(folder) should “just work” even without the trait.

Required methods

Use functions to fold a coproduct into a single value.

Please see the inherent method for more information.

The only difference between that inherent method and this trait method is the location of the type parameters. (here, they are on the trait rather than the method)


This is literally impossible; CNil is not instantiable