Macro frunk_core::Coprod

source ·
macro_rules! Coprod {
    () => { ... };
    (...$Rest:ty) => { ... };
    ($A:ty) => { ... };
    ($A:ty, $($tok:tt)*) => { ... };
}
Expand description

Returns a type signature for a Coproduct of the provided types

This is a type macro (introduced in Rust 1.13) that makes it easier to write nested type signatures.

§Examples

use frunk_core::Coprod;

type I32Bool = Coprod!(i32, bool);
let co1 = I32Bool::inject(3);

// Use ...Tail to append another coproduct at the end.
let co2 = <Coprod!(&str, String, ...I32Bool)>::inject(3);