Failure<S extends Object, F extends Object> class final

Represents a failure.

Inheritance

Constructors

Failure(F failure)
Creates a Failure.
const

Properties

failure → F
The value if this is a Failure or null otherwise.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
success Null
The value if this is a Success or null otherwise.
no setteroverride

Methods

bind<T extends Object>(Result<T, F> function(S success)) Result<T, F>
If this is a Success, maps S to Result, otherwise returns F untouched.
override
bindFailure<T extends Object>(Result<S, T> function(F failure)) Result<S, T>
If this is a Failure, maps F to Result, otherwise returns S untouched.
override
map<T extends Object>(T function(S success)) Result<T, F>
If this is a Success, maps S to T, otherwise returns F untouched.
override
mapFailure<T extends Object>(T function(F failure)) Result<S, T>
If this is a Failure, maps F to T, otherwise returns S untouched.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pipe<T extends Object>(Future<Result<T, F>> function(S success)) Future<Result<T, F>>
If this is a Success, asynchronously maps S to Result, otherwise returns F untouched.
override
pipeFailure<T extends Object>(Future<Result<S, T>> function(F failure)) Future<Result<S, T>>
If this is a Failure, asynchronously maps F to Result, otherwise returns S untouched.
override
toString() String
A string representation of this object.
override
when({Consume<S> success = Result._nothing, Consume<F> failure = Result._nothing}) → void
Calls success if this is a Success, or failure if this is a Failure.
override

Operators

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