Trait frunk_core::coproduct::CoprodInjector
source · pub trait CoprodInjector<InjectType, Index> {
// Required method
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§
sourcefn inject(to_insert: InjectType) -> Self
fn inject(to_insert: InjectType) -> Self
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)
Object Safety§
This trait is not object safe.