Crate either

source ·
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)] for Either

Re-exports

  • pub use crate::Either::Left;
  • pub use crate::Either::Right;

Macros

  • Evaluate the provided expression for both Either::Left and Either::Right.
  • Macro for unwrapping the left side of an Either, which fails early with the opposite side. Can only be used in functions that return Either because of the early return of Right that it provides.
  • Dual to try_left!, see its documentation for more information.

Enums

  • The enum Either with variants Left and Right is a general purpose sum type with two cases.