From bc2152266d0aa8b749d5202d54f9e7c4a5db5b5b Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sun, 23 Jun 2019 14:12:10 +0200 Subject: API documentation for KVision 0.0.37 --- api/pl.treksoft.kvision.cordova/-result/index.html | 202 +++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 api/pl.treksoft.kvision.cordova/-result/index.html (limited to 'api/pl.treksoft.kvision.cordova/-result/index.html') diff --git a/api/pl.treksoft.kvision.cordova/-result/index.html b/api/pl.treksoft.kvision.cordova/-result/index.html new file mode 100644 index 00000000..212fe4ae --- /dev/null +++ b/api/pl.treksoft.kvision.cordova/-result/index.html @@ -0,0 +1,202 @@ + + + +Result - kvision + + + +kvision / pl.treksoft.kvision.cordova / Result
+
+

Result

+sealed class Result<out V : Any, out E> +

Types

+ + + + + + + + + + + +
+

Failure

+
+class Failure<out E> : Result<Nothing, E>
+

Success

+
+class Success<out V : Any> : Result<V, Nothing>
+

Functions

+ + + + + + + + + + + + + + + + + + + +
+

component1

+
+open operator fun component1(): V?
+

component2

+
+open operator fun component2(): E?
+

fold

+
+fun <X> fold(success: (V) -> X, failure: (E) -> X): X
+

get

+
+abstract fun get(): V
+

Companion Object Functions

+ + + + + + + + + + + + + + + +
+

error

+
+fun <E> error(ex: E): Result.Failure<E>
+

of

+
+fun <V : Any> of(value: V?, fail: () -> Exception = { Exception() }): Result<V, Exception>
+fun <V : Any, E> of(f: () -> V): Result<V, E>
+

success

+
+fun <V : Any> success(v: V): Result.Success<V>
+

Extension Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

any

+
+fun <V : Any, E> Result<V, E>.any(predicate: (V) -> Boolean): Boolean
+

createInstance

+
+fun <T> Any?.createInstance(vararg args: dynamic): T +

Helper function for creating JavaScript objects from dynamic constructors.

+
+

failure

+
+fun <E> Result<*, E>.failure(f: (E) -> Unit): Unit
+

fanout

+
+fun <V : Any, U : Any> Result<V, *>.fanout(other: () -> Result<U, *>): Result<Pair<V, U>, *>
+

flatMap

+
+fun <V : Any, U : Any, E> Result<V, E>.flatMap(transform: (V) -> Result<U, E>): Result<U, E>
+

flatMapError

+
+fun <V : Any, E, E2> Result<V, E>.flatMapError(transform: (E) -> Result<V, E2>): Result<V, E2>
+

getAs

+
+fun <X> Result<*, *>.getAs(): X?
+

getOrElse

+
+infix fun <V : Any, E> Result<V, E>.getOrElse(fallback: V): V
+

map

+
+fun <V : Any, U : Any, E> Result<V, E>.map(transform: (V) -> U): Result<U, E>
+

mapError

+
+fun <V : Any, E, E2> Result<V, E>.mapError(transform: (E) -> E2): Result<V, E2>
+

or

+
+infix fun <V : Any, E> Result<V, E>.or(fallback: V): Result.Success<V>
+

success

+
+fun <V : Any> Result<V, *>.success(f: (V) -> Unit): Unit
+

Inheritors

+ + + + + + + + + + + +
+

Failure

+
+class Failure<out E> : Result<Nothing, E>
+

Success

+
+class Success<out V : Any> : Result<V, Nothing>
+ + -- cgit