10 unstable releases (3 breaking)

Uses old Rust 2015

0.4.0 Jul 24, 2018
0.3.0 Jul 24, 2018
0.2.3 Aug 30, 2017
0.1.3 Mar 2, 2017
0.1.0 Oct 12, 2016

#1232 in Data structures

Download history 14/week @ 2024-03-13 10/week @ 2024-03-27 19/week @ 2024-04-03 2/week @ 2024-05-15 6/week @ 2024-05-22

69 downloads per month
Used in oak

Apache-2.0

10KB
227 lines

Partial library

ptal on Travis CI

Similar to Option<T> with an additional Fake variant for accumulating errors beyond the first one. For example, in compiler, if a code analysis failed, we wish to continue a little further to obtain more errors.

Please consult the documentation.


lib.rs:

Partial is similar to Option where Value replaces Some and Nothing replaces None.

Similarly to Value, Fake contains a value of the right type that can be further used (e.g. in map or and_then) but this value is a dummy value used to be able to compute the rest and detect more errors. For any method, we have the ordering: Value > Fake > Nothing; a Fake value will never be a Value again.

Use case: When compiling, an error in one function must be reported but should not prevent the compilation of a second function to detect more errors in one run. This intermediate state is represented by Fake.

No runtime deps