Re: [PATCH v2 27/28] rust: types: add `Either` type

Josh Triplett
2022-12-02T23:42:03Z

On Fri, Dec 02, 2022 at 05:14:58PM +0100, ojeda@kernel.org wrote:
> From: Wedson Almeida Filho <wedsonaf@gmail.com>
>
> Introduce the new `types` module of the `kernel` crate with
> `Either` as its first type.
>
> `Either<L, R>` is a sum type that always holds either a value
> of type `L` (`Left` variant) or `R` (`Right` variant).
>
> For instance:
>
> struct Executor {
> queue: Either<BoxedQueue, &'static Queue>,
> }

This specific example seems like it would be better served by the
existing `Cow` type.