option 2.0.2
A simple library for optional values.
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:
Option
Option is a library for D. To avoid using null around the code, it introduce a Option type which wraps a possible-empty value.
The library provides:
- static methods to create
Optionobjects: somewhen theOptionobject contains a value;nonewhen theOptionobject does not contain a value;nullablewhen it is not known a priori whether the value exists or not;- class methods to retrieve essential informations about the
Optionobject: getto unwrap the value (throws an error when theOptionis empty);isEmptyto know whether theOptionobject is empty (value not present) or not;orto retrieve the wrapped value if is present, else the passed value (used as the default value). This method never throws.
- 2.0.2 released 4 years ago
- asperan/option
- MIT
- Copyright © 2021, Alex Speranza
- Authors:
- Dependencies:
- none
- Versions:
-
Show all 4 versions2.0.2 2021-Oct-13 2.0.1 2021-Oct-13 2.0.0 2021-Oct-13 ~main 2021-Oct-13 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
13 downloads this month
-
61 downloads total
-
- Score:
- 0.1
- Short URL:
- option.dub.pm