result 1.0.0
A minimal D library to wrap return values or error of functions.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Result
Result is a D library which provides the type Result, which wraps the return value of a function or an Error.
The type Result mimics Either from Scala or Result from Rust.
Result(T) is just an alias for SumType!(T, Error), so it can be used with any function from std.sumtype.
Usage example
Result!int result = 5;
result.match!(
(int i) => i == 5,
(Error e) => exit(1),
));
- 1.0.0 released 4 years ago
- asperan/result
- MIT
- Copyright © 2021, Alex "asperan" Speranza
- Authors:
- Dependencies:
- none
- Versions:
-
Show all 2 versions1.0.0 2021-Oct-16 ~main 2021-Oct-16 - Download Stats:
-
-
0 downloads today
-
3 downloads this week
-
5 downloads this month
-
29 downloads total
-
- Score:
- 0.1
- Short URL:
- result.dub.pm