]> git.proxmox.com Git - rustc.git/blob - vendor/either/README.rst
New upstream version 1.65.0+dfsg1
[rustc.git] / vendor / either / README.rst
1
2 Either
3 ======
4
5 The enum ``Either`` with variants ``Left`` and ``Right`` and trait
6 implementations including Iterator, Read, Write.
7
8 Either has methods that are similar to Option and Result.
9
10 Includes convenience macros ``try_left!()`` and ``try_right!()`` to use for
11 short-circuiting logic.
12
13 Please read the `API documentation here`__
14
15 __ https://docs.rs/either/
16
17 |build_status|_ |crates|_
18
19 .. |build_status| image:: https://github.com/bluss/either/workflows/CI/badge.svg?branch=master
20 .. _build_status: https://github.com/bluss/either/actions
21
22 .. |crates| image:: https://img.shields.io/crates/v/either.svg
23 .. _crates: https://crates.io/crates/either
24
25 How to use with cargo::
26
27 [dependencies]
28 either = "1.8"
29
30
31 Recent Changes
32 --------------
33
34 - 1.8.0
35
36 - **MSRV**: ``either`` now requires Rust 1.36 or later.
37
38 - Add new methods ``.as_pin_ref()`` and ``.as_pin_mut()`` to project a
39 pinned ``Either`` as inner ``Pin`` variants, by @cuviper (#77)
40
41 - Implement the ``Future`` trait, by @cuviper (#77)
42
43 - Specialize more methods of the ``io`` traits, by @Kixunil and @cuviper (#75)
44
45 - 1.7.0
46
47 - **MSRV**: ``either`` now requires Rust 1.31 or later.
48
49 - Export the macro ``for_both!``, by @thomaseizinger (#58)
50
51 - Implement the ``io::Seek`` trait, by @Kerollmops (#60)
52
53 - Add new method ``.either_into()`` for ``Into`` conversion, by @TonalidadeHidrica (#63)
54
55 - Add new methods ``.factor_ok()``, ``.factor_err()``, and ``.factor_none()``,
56 by @zachs18 (#67)
57
58 - Specialize ``source`` in the ``Error`` implementation, by @thomaseizinger (#69)
59
60 - Specialize more iterator methods and implement the ``FusedIterator`` trait,
61 by @Ten0 (#66) and @cuviper (#71)
62
63 - Specialize ``Clone::clone_from``, by @cuviper (#72)
64
65 - 1.6.1
66
67 - Add new methods ``.expect_left()``, ``.unwrap_left()``,
68 and equivalents on the right, by @spenserblack (#51)
69
70 - 1.6.0
71
72 - Add new modules ``serde_untagged`` and ``serde_untagged_optional`` to customize
73 how ``Either`` fields are serialized in other types, by @MikailBag (#49)
74
75 - 1.5.3
76
77 - Add new method ``.map()`` for ``Either<T, T>`` by @nvzqz (#40).
78
79 - 1.5.2
80
81 - Add new methods ``.left_or()``, ``.left_or_default()``, ``.left_or_else()``,
82 and equivalents on the right, by @DCjanus (#36)
83
84 - 1.5.1
85
86 - Add ``AsRef`` and ``AsMut`` implementations for common unsized types:
87 ``str``, ``[T]``, ``CStr``, ``OsStr``, and ``Path``, by @mexus (#29)
88
89 - 1.5.0
90
91 - Add new methods ``.factor_first()``, ``.factor_second()`` and ``.into_inner()``
92 by @mathstuf (#19)
93
94 - 1.4.0
95
96 - Add inherent method ``.into_iter()`` by @cuviper (#12)
97
98 - 1.3.0
99
100 - Add opt-in serde support by @hcpl
101
102 - 1.2.0
103
104 - Add method ``.either_with()`` by @Twey (#13)
105
106 - 1.1.0
107
108 - Add methods ``left_and_then``, ``right_and_then`` by @rampantmonkey
109 - Include license files in the repository and released crate
110
111 - 1.0.3
112
113 - Add crate categories
114
115 - 1.0.2
116
117 - Forward more ``Iterator`` methods
118 - Implement ``Extend`` for ``Either<L, R>`` if ``L, R`` do.
119
120 - 1.0.1
121
122 - Fix ``Iterator`` impl for ``Either`` to forward ``.fold()``.
123
124 - 1.0.0
125
126 - Add default crate feature ``use_std`` so that you can opt out of linking to
127 std.
128
129 - 0.1.7
130
131 - Add methods ``.map_left()``, ``.map_right()`` and ``.either()``.
132 - Add more documentation
133
134 - 0.1.3
135
136 - Implement Display, Error
137
138 - 0.1.2
139
140 - Add macros ``try_left!`` and ``try_right!``.
141
142 - 0.1.1
143
144 - Implement Deref, DerefMut
145
146 - 0.1.0
147
148 - Initial release
149 - Support Iterator, Read, Write
150
151 License
152 -------
153
154 Dual-licensed to be compatible with the Rust project.
155
156 Licensed under the Apache License, Version 2.0
157 https://www.apache.org/licenses/LICENSE-2.0 or the MIT license
158 https://opensource.org/licenses/MIT, at your
159 option. This file may not be copied, modified, or distributed
160 except according to those terms.