[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4qNR+Nn9utDftHq@localhost>
Date: Fri, 2 Dec 2022 15:41:59 -0800
From: Josh Triplett <josh@...htriplett.org>
To: ojeda@...nel.org
Cc: Wedson Almeida Filho <wedsonaf@...il.com>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
patches@...ts.linux.dev, Wei Liu <wei.liu@...nel.org>
Subject: Re: [PATCH v2 27/28] rust: types: add `Either` type
On Fri, Dec 02, 2022 at 05:14:58PM +0100, ojeda@...nel.org wrote:
> From: Wedson Almeida Filho <wedsonaf@...il.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.
Powered by blists - more mailing lists