A general purpose sum type with three cases: the enum Among with variants Left, Middle and Right. A three-way counterpart to Either, with no_std, serde, futures and tokio integrations.
The enum Among with variants Left, Middle and Right and trait implementations.
-
Use with default feature
[dependencies] among = "0.2"
-
Use without
stdandalloc[dependencies] among = { version = "0.2", default-features = false }
-
Enable
futuresfeature to enable trait implementation includingfutures::io::AsyncRead,futures::io::AsyncBufRead,futures::io::AsyncWrite, andfutures::io::AsyncSeek.[dependencies] among = { version = "0.2", features = ["futures", "std"] }
-
Enable
tokiofeature to enable trait implementation includingtokio::io::AsyncRead,tokio::io::AsyncBufRead,tokio::io::AsyncWriteandtokio::io::AsyncSeek.[dependencies] among = { version = "0.2", features = ["tokio", "std"] }
This code is inspired and modified based on rayon-rs/either.
among is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2026 Al Liu.