Trait frunk::coproduct::CoproductFoldable
source · pub trait CoproductFoldable<Folder, Output> {
// Required method
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§
sourcefn fold(self, f: Folder) -> Output
fn fold(self, f: Folder) -> Output
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)
Implementors§
impl<F, R> CoproductFoldable<F, R> for CNil
This is literally impossible; CNil is not instantiable