Result<TSuccess> class abstract

Implementers

Constructors

Result()
Constructs a new Result instance.
const
Result.error(Failure value)
Factory constructor to create an error result.
factory
Result.success(TSuccess value)
Factory constructor to create a success result.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fold<T>(T onError(Failure l), T onSuccess(TSuccess r)) → T
Executes the provided functions based on the result's state.
getError() Failure
Returns the error value if the result is an error, otherwise throws an exception.
getSuccess() → TSuccess
Returns the success value if the result is a success, otherwise calls orElse with the error value and returns its result.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited