Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

either

> 编程语言
Open source

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

562 stars0 likes1 views
WebsiteGitHub

About

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

Either

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

Either has methods that are similar to Option and Result, and it also implements traits like Iterator, Read, and Write.

The crate includes macros try_left!() and try_right!() to use for short-circuiting logic, similar to how the ? operator is used with Result. Note that Either is general purpose and unopinionated about the meaning of Left and Right. For describing success or error, use the regular Result.

Please read the API documentation here, and see RELEASES.md for the version history.

How to use with cargo:

toml
[dependencies]
either = "1"

License

Dual-licensed to be compatible with the Rust project.

Licensed under the Apache License, Version 2.0 or the MIT license , at your option. This file may not be copied, modified, or distributed except according to those terms.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustrust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言