Registry / utility / either

either

JSON →
library1.16.0rscratesunverified

The enum Either with variants Left and Right, a general purpose sum type.

# Cargo.toml [dependencies] either = "1.16.0"
INSTALL
IMPORT
SIG · EITHER
E
either
utilityrustv1.16.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Either
use either::Either;

Use Either to handle two possible types.

use either::Either; fn main() { let value: Either<i32, &str> = Either::Left(42); match value { Either::Left(x) => println!("Left: {}", x), Either::Right(s) => println!("Right: {}", s), } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.16.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
either — cargo add either · libregistry