linux-stable/rust/kernel
Wedson Almeida Filho ba20915bae rust: types: add Either type
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>,
    }

Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com>
Reviewed-by: Wei Liu <wei.liu@kernel.org>
[Reworded, adapted for upstream and applied latest changes]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-04 01:59:16 +01:00
..
allocator.rs
build_assert.rs rust: build_assert: add build_{error,assert}! macros 2022-12-04 01:59:16 +01:00
error.rs rust: error: add From implementations for Error 2022-12-04 01:59:15 +01:00
lib.rs rust: types: add Either type 2022-12-04 01:59:16 +01:00
prelude.rs rust: build_assert: add build_{error,assert}! macros 2022-12-04 01:59:16 +01:00
print.rs rust: print: add pr_cont! macro 2022-12-01 20:12:44 +01:00
static_assert.rs rust: static_assert: add static_assert! macro 2022-12-04 01:59:16 +01:00
std_vendor.rs rust: std_vendor: add dbg! macro based on std's one 2022-12-04 01:59:16 +01:00
str.rs rust: str: add fmt! macro 2022-12-04 01:59:16 +01:00
types.rs rust: types: add Either type 2022-12-04 01:59:16 +01:00