Constructs an Expected object that contains an expected value.
Constructs an Expected object that contains an error value.
Returns the error value. May only be called when hasValue returns false.
Checks whether this Expected object contains an expected value or an error value.
Assigns an expected value to an Expected object.
Assigns an error value to an Expected object.
Checks whether this Expected object contains a specific expected value.
Checks whether this Expected object contains a specific error value.
Checks whether this Expected object and rhs contain the same expected value or error value.
Returns the expected value if there is one. Otherwise, throws an exception
Returns the expected value if present, or a default value otherwise.
An Expected!(T, E) contains either an expected value of type T, or an error value of type E explaining why the expected value couldn't be produced.
The default type for the error value is Exception.
A function that returns an Expected object has the following advantages over one that may throw an exception or return an error code:
An Expected!(T, E) is initialized by default to contain the value T.init.