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

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

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

pub fn inject(to_insert: InjectType) -> Self[src]

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)

Loading content...

Implementors

impl<Head, I, Tail, TailIndex> CoprodInjector<I, There<TailIndex>> for Coproduct<Head, Tail> where
    Tail: CoprodInjector<I, TailIndex>, 
[src]

impl<I, Tail> CoprodInjector<I, Here> for Coproduct<I, Tail>[src]

Loading content...