result library

Classes

Err<S, F extends Object>
Error Result.
Ok<S, F extends Object>
Ok Result.
Result<S, F extends Object>
Result is used for propagating errors and represents the sum type of Ok and Err.

Extensions

FlattenExtension on Result<Result<S, F>, F>
FlattenFutureExtension on FutureResult<Result<S, F>, F>
FutureIterableFutureResultExtension on Future<Iterable<FutureResult<S, F>>>
FutureIterableResultExtension on Future<Iterable<Result<S, F>>>
FutureResultExtension on FutureResult<S, F>
FutureResult represents an asynchronous Result. And as such, inherits all of Results methods.
FutureResultNullExtension on Future<Result<S?, F>>
FutureResultOptionExtension on Future<Result<Option<S?>, F>>
InfallibleErrExtension on Result<Never, F>
InfallibleFutureErrExtension on FutureResult<Never, F>
InfallibleFutureOkExtension on FutureResult<S, Never>
InfallibleOkExtension on Result<S, Never>
IterableFutureResultExtension on Iterable<FutureResult<S, F>>
IterableResultExtension on Iterable<Result<S, F>>
NullResultExtension on Result<S, F>?
RecordFunctionToResult10 on (Result<A, Z> Function(), Result<B, Z> Function(), Result<C, Z> Function(), Result<D, Z> Function(), Result<E, Z> Function(), Result<F, Z> Function(), Result<G, Z> Function(), Result<H, Z> Function(), Result<I, Z> Function(), Result<J, Z> Function())
RecordFunctionToResult2 on (Result<A, Z> Function(), Result<B, Z> Function())
RecordFunctionToResult3 on (Result<A, Z> Function(), Result<B, Z> Function(), Result<C, Z> Function())
RecordFunctionToResult4 on (Result<A, Z> Function(), Result<B, Z> Function(), Result<C, Z> Function(), Result<D, Z> Function())
RecordFunctionToResult5 on (Result<A, Z> Function(), Result<B, Z> Function(), Result<C, Z> Function(), Result<D, Z> Function(), Result<E, Z> Function())
RecordFunctionToResult6 on (Result<A, Z> Function(), Result<B, Z> Function(), Result<C, Z> Function(), Result<D, Z> Function(), Result<E, Z> Function(), Result<F, Z> Function())
RecordFunctionToResult7 on (Result<A, Z> Function(), Result<B, Z> Function(), Result<C, Z> Function(), Result<D, Z> Function(), Result<E, Z> Function(), Result<F, Z> Function(), Result<G, Z> Function())
RecordFunctionToResult8 on (Result<A, Z> Function(), Result<B, Z> Function(), Result<C, Z> Function(), Result<D, Z> Function(), Result<E, Z> Function(), Result<F, Z> Function(), Result<G, Z> Function(), Result<H, Z> Function())
RecordFunctionToResult9 on (Result<A, Z> Function(), Result<B, Z> Function(), Result<C, Z> Function(), Result<D, Z> Function(), Result<E, Z> Function(), Result<F, Z> Function(), Result<G, Z> Function(), Result<H, Z> Function(), Result<I, Z> Function())
RecordToResult10 on (Result<A, Z>, Result<B, Z>, Result<C, Z>, Result<D, Z>, Result<E, Z>, Result<F, Z>, Result<G, Z>, Result<H, Z>, Result<I, Z>, Result<J, Z>)
RecordToResult2 on (Result<A, Z>, Result<B, Z>)
RecordToResult3 on (Result<A, Z>, Result<B, Z>, Result<C, Z>)
RecordToResult4 on (Result<A, Z>, Result<B, Z>, Result<C, Z>, Result<D, Z>)
RecordToResult5 on (Result<A, Z>, Result<B, Z>, Result<C, Z>, Result<D, Z>, Result<E, Z>)
RecordToResult6 on (Result<A, Z>, Result<B, Z>, Result<C, Z>, Result<D, Z>, Result<E, Z>, Result<F, Z>)
RecordToResult7 on (Result<A, Z>, Result<B, Z>, Result<C, Z>, Result<D, Z>, Result<E, Z>, Result<F, Z>, Result<G, Z>)
RecordToResult8 on (Result<A, Z>, Result<B, Z>, Result<C, Z>, Result<D, Z>, Result<E, Z>, Result<F, Z>, Result<G, Z>, Result<H, Z>)
RecordToResult9 on (Result<A, Z>, Result<B, Z>, Result<C, Z>, Result<D, Z>, Result<E, Z>, Result<F, Z>, Result<G, Z>, Result<H, Z>, Result<I, Z>)
ResultFutureToFutureResultExtension on Result<Future<S>, F>
ResultNullExtension on Result<S?, F>
ResultOptionExtension on Result<Option<S?>, F>
ResultToFutureResultExtension on Result<S, F>
ToErrExtension on E
ToOkExtension on S

Functions

guard<S>(S func()) Result<S, Object>
Executes the function in a protected context. func is called inside a try catch block. If the result does not catch, then return value func returned inside an Ok. If func throws, then the thrown value is returned inside an Err.
guardAsync<S>(Future<S> func()) FutureResult<S, Object>
Async version of guard
guardAsyncResult<S>(Future<Result<S, Object>> func()) FutureResult<S, Object>
Async version of guardResult
guardResult<S>(Result<S, Object> func()) Result<S, Object>
Result unwrapping version of guard. Where func returns an Result, but can still throw.

Typedefs

FutureResult<S, F extends Object> = Future<Result<S, F>>
FutureResult represents an asynchronous Result. And as such, inherits all of Results methods.