result library
This is the result
library, containing only the Result type and its helpers.
This library can be imported via:
import 'package:option_result/result.dart';
If you want to import both Option
and Result
types, consider importing the
combined library:
import 'package:option_result/option_result.dart';
Classes
Extensions
-
ResultFlatten
on Result<
Result< T, E> , E> -
Provides the
flatten()
method to Result type values that hold another Result. -
ResultPropagateShortcut
on Result<
T, E> Function() -
Provides the
~
shortcut for functions that return Result to allow propagating unwrapped Err values up the call stack. -
ResultPropagateShortcutAsync
on Future<
Result< Function()T, E> > -
Provides the
~
shortcut for asynchronous functions that return Result to allow propagating unwrapped Err values up the call stack. -
ResultTranspose
on Result<
Option< T> , E> -
Provides the
transpose()
method to Result type values that hold an Option value.
Functions
-
propagateResult<
T, E> (Result< T, E> fn()) → Result<T, E> - Executes the given function, returning the returned Result value.
-
propagateResultAsync<
T, E> (FutureOr< Result< fn()) → Future<T, E> >Result< T, E> > - Executes the given function asynchronously, returning the returned Result value.
Exceptions / Errors
-
ResultError<
T, E> - Represents an error thrown by a mishandled Result type value.