Expand description
Among
The enum Among with variants Left, Middle and Right is a general purpose sum type with three cases.
English | 简体中文
§Introduction
The enum Among with variants Left, Middle and Right and trait implementations.
§Installation
-
Use with default feature
[dependencies] among = "0.1" -
Use without
stdandalloc[dependencies] among = { version = "0.1", 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.1", features = ["futures", "std"] } -
Enable
tokiofeature to enable trait implementation includingtokio::io::AsyncRead,tokio::io::AsyncBufRead,tokio::io::AsyncWriteandtokio::io::AsyncSeek.[dependencies] among = { version = "0.1", features = ["tokio", "std"] }
§Pedigree
This code is inspired and modified based on rayon-rs/either.
§License
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) 2024 Al Liu.
Re-exports§
Modules§
- serde_
untagged - Untagged serialization/deserialization support for
Among<L, M, R>. - serde_
untagged_ optional - Untagged serialization/deserialization support for
Option<Among<L, M, R>>.
Macros§
- for_all
- Evaluate the provided expression for both
Among::LeftandAmong::Right.
Structs§
- Iter
Among - Iterator that maps left or right iterators to corresponding
Among-wrapped items.
Enums§
- Among
- The enum
Amongwith variantsLeft,MiddleandRightis a general purpose sum type with three cases.
Traits§
- Among
Error Ext - An extension trait for
Result<_, Among<A, B, C>>that provides additional methods. - Among
OkExt - An extension trait for
Result<Among<A, B, C>, _>that provides additional methods. - Either
ErrExt either - An extension trait for
Result<T, Either<A, B>>that provides additional methods. - Either
OkExt either - An extension trait for
Result<Either<A, B>, _>that provides additional methods. - Into
Among - Provides methods for converting a type
Selfinto among aLeftMiddleorRightvariant ofAmong<Self, Self>.