base library
Base implementation of the Result Type and tools
Classes
Extensions
-
FlattenExtension
on Result<
Result< S, F> , F> -
FlattenFutureExtension
on FutureResult<
Result< S, F> , F> -
FutureIterableFutureResultExtensions
on Future<
Iterable< FutureResult< >S, F> > -
FutureIterableResultExtensions
on Future<
Iterable< Result< >S, F> > -
FutureResultExtension
on FutureResult<
S, F> - FutureResult represents an asynchronous Result. And as such, inherits all of Results methods.
-
InfallibleErrExtension
on Result<
Never, F> -
InfallibleFutureErrExtension
on FutureResult<
Never, F> -
InfallibleFutureOkExtension
on FutureResult<
S, Never> -
InfallibleOkExtension
on Result<
S, Never> -
IterableFutureResultExtensions
on Iterable<
FutureResult< S, F> > -
IterableResultExtensions
on Iterable<
Result< S, F> > -
ResultFutureToFutureResultExtension
on Result<
Future< S> , F> -
ResultToFutureResultExtension
on Result<
S, F> -
TransposeFutureResultExtension
on FutureResult<
S?, F> -
TransposeResultExtension
on Result<
S?, F>
Functions
-
executeProtected<
S> (S func()) → Result< S, Object> -
Executes the function in a protected context.
func
is called inside a try catch block. If the result is not catch, then return valuefunc
returned inside an Ok. Iffunc
throws, then the thrown value is returned inside an Err. -
executeProtectedAsync<
S> (Future< S> func()) → FutureResult<S, Object> - Async version of executeProtected
-
executeProtectedAsyncResult<
S> (Future< Result< func()) → FutureResult<S, Object> >S, Object> - Async version of executeProtectedResult
-
executeProtectedResult<
S> (Result< S, Object> func()) → Result<S, Object> -
Result unwrapping version of executeProtected. 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.
- Infallible = Never
- The error type for errors that can never happen
- Unit = ()
- Type alias for (). Used for a Result when the returned value does not matter. Preferred over void since forces stricter types. See unit, okay, and error