FtrResultExt<S, E> extension
Extension methods for FtrResult to provide convenient asynchronous operations. This extension allows chaining operations on Future
- on
-
- FtrResult<
S, E>
- FtrResult<
Properties
-
isError
→ Future<
bool> -
Available on FtrResult<
Asynchronously checks if this result represents an error.S, E> , provided by the FtrResultExt extensionno setter -
isSuccess
→ Future<
bool> -
Available on FtrResult<
Asynchronously checks if this result represents a success.S, E> , provided by the FtrResultExt extensionno setter
Methods
-
execute(
) → Future< void> -
Available on FtrResult<
Asynchronously forces evaluation of the result without returning any value.S, E> , provided by the FtrResultExt extension -
flat(
) → Future< (S?, E?)> -
Available on FtrResult<
Asynchronously flattens the result into a tuple.S, E> , provided by the FtrResultExt extension -
getOrNull(
) → Future< S?> -
Available on FtrResult<
Asynchronously extracts the success value or returns null if the result is an error.S, E> , provided by the FtrResultExt extension -
getOrThrow(
) → Future< S> -
Available on FtrResult<
Asynchronously extracts the success value or throws an exception if the result is an error.S, E> , provided by the FtrResultExt extension -
mapError<
E2> (E2 mapper(E err)) → FtrResult< S, E2> -
Available on FtrResult<
Asynchronously transforms the error value using a simple mapper function.S, E> , provided by the FtrResultExt extension -
mapOnError<
E2> (FutureOr< Result< mapper(E err)) → FtrResult<S, E2> >S, E2> -
Available on FtrResult<
Asynchronously transforms the error value using a mapper that returns a Result.S, E> , provided by the FtrResultExt extension -
mapOnSuccess<
S2> (FutureOr< Result< mapper(S data)) → FtrResult<S2, E> >S2, E> -
Available on FtrResult<
Asynchronously transforms the success value using a mapper that returns a Result.S, E> , provided by the FtrResultExt extension -
mapSuccess<
S2> (S2 mapper(S data)) → FtrResult< S2, E> -
Available on FtrResult<
Asynchronously transforms the success value using a simple mapper function.S, E> , provided by the FtrResultExt extension -
nullable(
) → FtrResult< S?, E> -
Available on FtrResult<
Asynchronously converts the result to allow nullable success values.S, E> , provided by the FtrResultExt extension -
onError(
void onError(E error)) → FtrResult< S, E> -
Available on FtrResult<
Asynchronously executes a side effect if the result is an error.S, E> , provided by the FtrResultExt extension -
onSuccess(
void onSuccess(S data)) → FtrResult< S, E> -
Available on FtrResult<
Asynchronously executes a side effect if the result is successful.S, E> , provided by the FtrResultExt extension -
resolve(
{required S onError(E error)}) → Future< Success< S, E> > -
Available on FtrResult<
Asynchronously converts any error result into a successful result.S, E> , provided by the FtrResultExt extension -
when<
T> ({required T success(S data), required T error(E error)}) → Future< T> -
Available on FtrResult<
Asynchronously pattern matches on the result and executes the appropriate callback.S, E> , provided by the FtrResultExt extension