https://github.com/al8n/among
The enum Among with variants Left, Middle and Right is a general purpose sum type with three cases.
https://github.com/al8n/among
either rust rust-patterns
Last synced: 5 months ago
JSON representation
The enum Among with variants Left, Middle and Right is a general purpose sum type with three cases.
- Host: GitHub
- URL: https://github.com/al8n/among
- Owner: al8n
- License: apache-2.0
- Created: 2024-09-02T11:00:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-14T08:25:22.000Z (12 months ago)
- Last Synced: 2025-05-08T19:53:40.610Z (5 months ago)
- Topics: either, rust, rust-patterns
- Language: Rust
- Homepage:
- Size: 91.8 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
Awesome Lists containing this project
README
Among
The enum `Among` with variants `Left`, `Middle` and `Right` is a general purpose sum type with three cases.
[
][Github-url]
![]()
[][CI-url]
[
][doc-url]
[][crates-url]
[][crates-url]
English | [简体中文][zh-cn-url]
## Introduction
The enum `Among` with variants `Left`, `Middle` and `Right` and trait implementations.
## Installation
- Use with default feature
```toml
[dependencies]
among = "0.1"
```- Use without `std` and `alloc`
```toml
[dependencies]
among = { version = "0.1", default-features = false }
```- Enable `futures` feature to enable trait implementation including `futures::io::AsyncRead`, `futures::io::AsyncBufRead`, `futures::io::AsyncWrite`, and `futures::io::AsyncSeek`.
```toml
[dependencies]
among = { version = "0.1", features = ["futures", "std"] }
```- Enable `tokio` feature to enable trait implementation including `tokio::io::AsyncRead`, `tokio::io::AsyncBufRead`, `tokio::io::AsyncWrite` and `tokio::io::AsyncSeek`.
```toml
[dependencies]
among = { version = "0.1", features = ["tokio", "std"] }
```## Pedigree
This code is inspired and modified based on [`rayon-rs/either`](https://github.com/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-APACHE), [LICENSE-MIT](LICENSE-MIT) for details.
Copyright (c) 2024 Al Liu.
[Github-url]: https://github.com/al8n/among/
[CI-url]: https://github.com/al8n/among/actions/workflows/ci.yml
[doc-url]: https://docs.rs/among
[crates-url]: https://crates.io/crates/among
[codecov-url]: https://app.codecov.io/gh/al8n/among/
[zh-cn-url]: https://github.com/al8n/among/tree/main/README-zh_CN.md