]> Git Repo - J-linux.git/blob - rust/kernel/types.rs
rust: types: add `Either` type
[J-linux.git] / rust / kernel / types.rs
1 // SPDX-License-Identifier: GPL-2.0
2
3 //! Kernel types.
4
5 /// A sum type that always holds either a value of type `L` or `R`.
6 pub enum Either<L, R> {
7     /// Constructs an instance of [`Either`] containing a value of type `L`.
8     Left(L),
9
10     /// Constructs an instance of [`Either`] containing a value of type `R`.
11     Right(R),
12 }
This page took 0.028436 seconds and 4 git commands to generate.