Trait frunk::coproduct::CoprodInjector[][src]

pub trait CoprodInjector<InjectType, Index> {
    fn inject(to_insert: InjectType) -> Self;
}
Expand description

Trait for instantiating a coproduct from an element

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

You only need to import this trait when working with generic Coproducts of unknown type. In most code, Coproduct::inject will “just work,” with or without this trait.

Required methods

Instantiate a coproduct from an element.

Please see the inherent static 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