.. /index

either

either

either provides the canonical Either<L, R> sum type with Left and Right variants. It implements Iterator, Read, Write, and other standard traits via delegation to the inner type. Simple, battle-tested, and ubiquitous in the Rust ecosystem.

For more than two types, frunk's Coproduct provides type-level sum types (Coprod!(i32, f32, bool)) with inject/get/fold operations, and anon_enum offers pre-built Enum2 through Enum16. See rust-enum-crates for the full generic sum type landscape.

Linked from

Sources