Trait frunk::coproduct::CoproductEmbedder

source ·
pub trait CoproductEmbedder<Out, Indices> {
    // Required method
    fn embed(self) -> Out;
}
Expand description

Trait for converting a coproduct into another that can hold its variants.

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

You only need to import this trait when working with generic Coproducts of unknown type. If you have a Coproduct of known type, then co.embed() should “just work” even without the trait.

Required Methods§

source

fn embed(self) -> Out

Convert a coproduct into another that can hold its variants.

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§

source§

impl CoproductEmbedder<CNil, HNil> for CNil

source§

impl<Head, Tail> CoproductEmbedder<Coproduct<Head, Tail>, HNil> for CNil
where CNil: CoproductEmbedder<Tail, HNil>,

source§

impl<Head, Tail, Out, NHead, NTail> CoproductEmbedder<Out, HCons<NHead, NTail>> for Coproduct<Head, Tail>
where Out: CoprodInjector<Head, NHead>, Tail: CoproductEmbedder<Out, NTail>,