Complete the code to define a generic enum with one type parameter.
enum Option<T> {
Some(T),
[1],
}The standard generic enum Option uses None as the variant representing no value.
Complete the code to create a generic enum with two type parameters.
enum Result<T, E> {
Ok(T),
[1](E),
}The standard generic enum Result uses Err as the variant for errors.
Fix the error in the generic enum definition by completing the missing variant name.
enum Either<L, R> {
Left(L),
[1](R),
}The generic enum Either uses Left and Right variants to hold values of two types.
Fill both blanks to define a generic enum with two variants holding different types.
enum Pair<T, U> {
First([1]),
[2](U),
}The enum Pair holds two types: T and U. The variants are named First and Second.
Fill all three blanks to define a generic enum with three variants holding different types.
enum Triple<A, B, C> {
First([1]),
Second([2]),
[3](C),
}The enum Triple has three variants: First, Second, and Third, holding types A, B, and C respectively.