sealed class WebcomResult<out T>
Wraps the result of a computation of type T.
It is typically used for implementing callbacks that may fail in various methods such as WebcomApplication.withAsset or AuthenticationService.unauthenticate, GuestMethod.authenticate... or DatasyncNode.subscribe.
data class Failure : WebcomResult<Nothing>
Represents a failed computation with an error that originated the failure. |
|
data class Success<out T> : WebcomResult<T>
Represents a successful computation with a result of type T. |
abstract val failureError: WebcomError?
Gets the error of computation when failed, or |
abstract fun get(): T
Gets the result of computation when successful, throws otherwise. |
|
abstract fun getOrElse(default: T): T
Gets the result of the computation when successful, or a given default value otherwise. |
|
abstract fun getOrNull(): T?
Gets the result of the computation when successful, or |
|
abstract fun isSuccess(): Boolean
Indicates whether the computation was successful. |
|
abstract fun <U> map(f: (T) -> U): WebcomResult<U>
Maps the result of this computation using the given f function. |
data class Failure : WebcomResult<Nothing>
Represents a failed computation with an error that originated the failure. |
|
data class Success<out T> : WebcomResult<T>
Represents a successful computation with a result of type T. |