Expand description
The enum Either with variants Left and Right is a general purpose
sum type with two cases.
Crate features:
-
"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 trait
IntoEitherprovides methods for converting a typeSelf, whose size is constant and known at compile-time, into anEithervariant. - iterator ๐
Macrosยง
- check_t ๐
- A helper macro to check if AsRef and AsMut are implemented for a given type.
- for_
both - Evaluate the provided expression for both
Either::LeftandEither::Right. - impl_
specific_ ๐ref_ and_ mut - map_
either ๐ - try_
left - Macro for unwrapping the left side of an
Either, which fails early with the opposite side. Can only be used in functions that returnEitherbecause of the early return ofRightthat it provides. - try_
right - Dual to
try_left!, see its documentation for more information.
Structsยง
- Iter
Either - Iterator that maps left or right iterators to corresponding
Either-wrapped items.
Enumsยง
- Either
- The enum
Eitherwith variantsLeftandRightis a general purpose sum type with two cases.
Traitsยง
- Into
Either - Provides methods for converting a type
Selfinto either aLeftorRightvariant ofEither<Self, Self>.