We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Either
1 parent 2db6795 commit c94d8cdCopy full SHA for c94d8cd
rust/kernel/types.rs
@@ -461,6 +461,15 @@ impl<T: AlwaysRefCounted> Drop for ARef<T> {
461
}
462
463
/// A sum type that always holds either a value of type `L` or `R`.
464
+///
465
+/// # Examples
466
467
+/// ```
468
+/// use kernel::types::Either;
469
470
+/// let left_value: Either<i32, &str> = Either::Left(7);
471
+/// let right_value: Either<i32, &str> = Either::Right("right value");
472
473
pub enum Either<L, R> {
474
/// Constructs an instance of [`Either`] containing a value of type `L`.
475
Left(L),
0 commit comments