Expand description
The enum Either
with variants Left
and Right
is a general purpose
sum type with two cases.
Crate features:
-
"use_std"
Enabled by default. Disable to make the library#![no_std]
. -
"serde"
Disabled by default. Enable to#[derive(Serialize, Deserialize)]
forEither
Re-exportsยง
Modulesยง
- into_
either ๐The traitIntoEither
provides methods for converting a typeSelf
, whose size is constant and known at compile-time, into anEither
variant. - iterator ๐
Macrosยง
- check_t ๐A helper macro to check if AsRef and AsMut are implemented for a given type.
- Evaluate the provided expression for both
Either::Left
andEither::Right
. - map_
either ๐ - Macro for unwrapping the left side of an
Either
, which fails early with the opposite side. Can only be used in functions that returnEither
because of the early return ofRight
that it provides. - Dual to
try_left!
, see its documentation for more information.
Structsยง
- Iterator that maps left or right iterators to corresponding
Either
-wrapped items.
Enumsยง
- The enum
Either
with variantsLeft
andRight
is a general purpose sum type with two cases.
Traitsยง
- Provides methods for converting a type
Self
into either aLeft
orRight
variant ofEither<Self, Self>
.