• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..07-Aug-2020-

src/H07-Aug-2020-981531

.cargo-checksum.jsonH A D03-May-202227 11

.travis.ymlH A D07-Aug-2020439 3025

Cargo.tomlH A D07-Aug-2020701 3224

LICENSE-APACHEH A D07-Aug-202010.6 KiB202169

LICENSE-MITH A D07-Aug-20201 KiB2622

README-crates.io.mdH A D07-Aug-2020441 118

README.rstH A D07-Aug-20202.4 KiB12069

README-crates.io.md

1The enum `Either` with variants `Left` and `Right` is a general purpose
2sum type with two cases.
3
4Either has methods that are similar to Option and Result, and it also implements
5traits like `Iterator`.
6
7Includes macros `try_left!()` and `try_right!()` to use for
8short-circuiting logic, similar to how the `?` operator is used with `Result`.
9Note that `Either` is general purpose. For describing success or error, use the
10regular `Result`.
11

README.rst

1
2Either
3======
4
5The enum ``Either`` with variants ``Left`` and ``Right`` and trait
6implementations including Iterator, Read, Write.
7
8Either has methods that are similar to Option and Result.
9
10Includes convenience macros ``try_left!()`` and ``try_right!()`` to use for
11short-circuiting logic.
12
13Please read the `API documentation here`__
14
15__ https://docs.rs/either/
16
17|build_status|_ |crates|_
18
19.. |build_status| image:: https://travis-ci.org/bluss/either.svg?branch=master
20.. _build_status: https://travis-ci.org/bluss/either
21
22.. |crates| image:: http://meritbadge.herokuapp.com/either
23.. _crates: https://crates.io/crates/either
24
25How to use with cargo::
26
27    [dependencies]
28    either = "1.5"
29
30
31Recent Changes
32--------------
33
34- 1.5.3
35
36  - Add new method ``.map()`` for ``Either<T, T>`` by @nvzqz (#40).
37
38- 1.5.2
39
40  - Add new methods ``.left_or()``,  ``.left_or_default()``,  ``.left_or_else()``,
41    and equivalents on the right, by @DCjanus (#36)
42
43- 1.5.1
44
45  - Add ``AsRef`` and ``AsMut`` implementations for common unsized types:
46    ``str``, ``[T]``, ``CStr``, ``OsStr``, and ``Path``, by @mexus (#29)
47
48- 1.5.0
49
50  - Add new methods ``.factor_first()``, ``.factor_second()`` and ``.into_inner()``
51    by @mathstuf (#19)
52
53- 1.4.0
54
55  - Add inherent method ``.into_iter()`` by @cuviper (#12)
56
57- 1.3.0
58
59  - Add opt-in serde support by @hcpl
60
61- 1.2.0
62
63  - Add method ``.either_with()`` by @Twey (#13)
64
65- 1.1.0
66
67  - Add methods ``left_and_then``, ``right_and_then`` by @rampantmonkey
68  - Include license files in the repository and released crate
69
70- 1.0.3
71
72  - Add crate categories
73
74- 1.0.2
75
76  - Forward more ``Iterator`` methods
77  - Implement ``Extend`` for ``Either<L, R>`` if ``L, R`` do.
78
79- 1.0.1
80
81  - Fix ``Iterator`` impl for ``Either`` to forward ``.fold()``.
82
83- 1.0.0
84
85  - Add default crate feature ``use_std`` so that you can opt out of linking to
86    std.
87
88- 0.1.7
89
90  - Add methods ``.map_left()``, ``.map_right()`` and ``.either()``.
91  - Add more documentation
92
93- 0.1.3
94
95  - Implement Display, Error
96
97- 0.1.2
98
99  - Add macros ``try_left!`` and ``try_right!``.
100
101- 0.1.1
102
103  - Implement Deref, DerefMut
104
105- 0.1.0
106
107  - Initial release
108  - Support Iterator, Read, Write
109
110License
111-------
112
113Dual-licensed to be compatible with the Rust project.
114
115Licensed under the Apache License, Version 2.0
116http://www.apache.org/licenses/LICENSE-2.0 or the MIT license
117http://opensource.org/licenses/MIT, at your
118option. This file may not be copied, modified, or distributed
119except according to those terms.
120