ResultPipingAsync<T> extension
Methods
-
ok<
T2> (T2 f(T)) → Future< Result< T2> > -
Available on Future<
IfResult< , provided by the ResultPipingAsync extensionT> >result
isErr
then returns thisErr
as is. Ifresult
isOk
then returns result of callf(result.val)
. Result of call f() must be a value of type T2. -
okAsync<
T2> (Future< T2> f(T)) → Future<Result< T2> > -
Available on Future<
IfResult< , provided by the ResultPipingAsync extensionT> >result
isErr
then returns thisErr
as is. Ifresult
isOk
then returns result of callawait f(result.val)
. Result of call f() must be a value of type T2. -
onErr(
dynamic f(Error)) → Future< Result< T> > -
Available on Future<
Calls f(result.err) with side effect if this result is Err. Anyway returns this result as is.Result< , provided by the ResultPipingAsync extensionT> > -
onOk(
dynamic f(T)) → Future< Result< T> > -
Available on Future<
Calls f(result.val) with side effect if this result is Ok. Anyway returns this result as is.Result< , provided by the ResultPipingAsync extensionT> > -
onResult(
dynamic f(Result< T> )) → Future<Result< T> > -
Available on Future<
Calls f(this) with side effect and return this as is.Result< , provided by the ResultPipingAsync extensionT> > -
or(
T? f()) → Future< Result< T> > -
Available on Future<
If this result is Ok, then returns it as is. If this result is Err, then callResult< , provided by the ResultPipingAsync extensionT> >result = f()
. If result of call f() is null, then returns Err. If result of call f() is value , then return Ok(value). If call of f() throws exception, then returns Err. -
orAsync(
Future< T?> f()) → Future<Result< T> > -
Available on Future<
If this result is Ok, then returns it as is. If this result is Err, then callResult< , provided by the ResultPipingAsync extensionT> >result = await f()
. If result of call f() is null, then returns Err. If result of call f() is value, then return Ok(value). If call of f() throws exception, then returns Err. -
pipe<
T2> (dynamic f(T)) → Future< Result< T2> > -
Available on Future<
IfResult< , provided by the ResultPipingAsync extensionT> >result
isErr
then returns thisErr
as is. Ifresult
isOk
then returns result of call f(result.val). If result of call f() is null - returns Err('function returned null'). If result of call f() isResult
- returns it as is. If call of f() throws exception, then returnsErr
. -
pipeAsync<
T2> (Future f(T)) → Future< Result< T2> > -
Available on Future<
IfResult< , provided by the ResultPipingAsync extensionT> >result
isErr
then returns thisErr
as is. Ifresult
isOk
then returns result of callawait f(result.val)
. If result of call f() is null - returns Err('function returned null'). If result of call f() isResult
- returns it as is. If call of f() throws exception, then returnsErr
.