retrofit-adapters-demo
1.0.2
retrofit-adapters-result
/
com.skydoves.retrofit.adapters.result
Package
com.
skydoves.
retrofit.
adapters.
result
Types
Functions
Types
Result
Call
Adapter
Factory
Link copied to clipboard
class
ResultCallAdapterFactory
:
CallAdapter.Factory
Content copied to clipboard
Functions
fold
Suspend
Link copied to clipboard
inline suspend
fun
<
R
,
T
>
Result
<
T
>
.
foldSuspend
(
crossinline
onSuccess
:
suspend
(
value
:
T
)
->
R
,
crossinline
onFailure
:
suspend
(
exception
:
Throwable
)
->
R
)
:
R
Content copied to clipboard
map
Suspend
Link copied to clipboard
inline suspend
fun
<
R
,
T
>
Result
<
T
>
.
mapSuspend
(
crossinline
transform
:
suspend
(
value
:
T
)
->
R
)
:
Result
<
R
>
Content copied to clipboard
on
Failure
Suspend
Link copied to clipboard
inline suspend
fun
<
T
>
Result
<
T
>
.
onFailureSuspend
(
crossinline
action
:
suspend
(
exception
:
Throwable
)
->
Unit
)
:
Result
<
T
>
Content copied to clipboard
on
Failure
Suspend
As
Error
Link copied to clipboard
inline suspend
fun
<
T
,
E
>
Result
<
T
>
.
onFailureSuspendAsError
(
crossinline
action
:
suspend
(
errorModel
:
E
?
)
->
Unit
)
:
Result
<
T
>
Content copied to clipboard
on
Success
Suspend
Link copied to clipboard
inline suspend
fun
<
T
>
Result
<
T
>
.
onSuccessSuspend
(
crossinline
action
:
suspend
(
value
:
T
)
->
Unit
)
:
Result
<
T
>
Content copied to clipboard
recover
Suspend
Link copied to clipboard
inline suspend
fun
<
R
,
T
:
R
>
Result
<
T
>
.
recoverSuspend
(
crossinline
transform
:
suspend
(
exception
:
Throwable
)
->
R
)
:
Result
<
R
>
Content copied to clipboard
run
Catching
Suspend
Link copied to clipboard
inline suspend
fun
<
R
>
runCatchingSuspend
(
crossinline
block
:
suspend
(
)
->
R
)
:
Result
<
R
>
Content copied to clipboard
inline suspend
fun
<
T
,
R
>
T
.
runCatchingSuspend
(
crossinline
block
:
suspend
T
.
(
)
->
R
)
:
Result
<
R
>
Content copied to clipboard