public class GetKt
| Modifier and Type | Method and Description |
|---|---|
static <V,E> V |
get(Result<? extends V,? extends E> $receiver)
|
static <V,E> E |
getError(Result<? extends V,? extends E> $receiver)
|
static <V,E> E |
getErrorOr(Result<? extends V,? extends E> $receiver,
E p)
Deprecated.
|
static <V,E> E |
getErrorOr(Result<? extends V,? extends E> $receiver,
kotlin.jvm.functions.Function0<? extends E> p)
Returns the error if this
class Result is class Err, otherwise default. |
static <V,E> E |
getErrorOrElse(Result<? extends V,? extends E> $receiver,
kotlin.jvm.functions.Function1<? super V,? extends E> transform)
Returns the error if this
class Result is class Err, otherwise
the transformation of the value. |
static <V,E> V |
getOr(Result<? extends V,? extends E> $receiver,
V p)
Deprecated.
|
static <V,E> V |
getOr(Result<? extends V,? extends E> $receiver,
kotlin.jvm.functions.Function0<? extends V> p)
Returns the value if this
class Result is class Ok, otherwise default. |
static <V,E> V |
getOrElse(Result<? extends V,? extends E> $receiver,
kotlin.jvm.functions.Function1<? super E,? extends V> transform)
Returns the value if this
class Result is class Ok, otherwise
the transformation of the error. |
public static <V,E> V get(Result<? extends V,? extends E> $receiver)
Returns the value if this class Result is class Ok, otherwise null.
Elm: Result.toMaybe
Rust: Result.ok
class Result,
class Ok,
Result.toMaybe,
Result.okpublic static <V,E> E getError(Result<? extends V,? extends E> $receiver)
Returns the error if this class Result is class Err, otherwise null.
Rust: Result.err
class Result,
class Err,
Result.errpublic static <V,E> V getOr(Result<? extends V,? extends E> $receiver, V p)
public static <V,E> V getOr(Result<? extends V,? extends E> $receiver, kotlin.jvm.functions.Function0<? extends V> p)
Returns the value if this class Result is class Ok, otherwise default.
class Ok, otherwise default.class Result,
class Ok,
Result.withDefault,
Result.fromLeft,
https://doc.rust-lang.org/std/result/enum.Result.html#method.unwrap_orpublic static <V,E> E getErrorOr(Result<? extends V,? extends E> $receiver, E p)
public static <V,E> E getErrorOr(Result<? extends V,? extends E> $receiver, kotlin.jvm.functions.Function0<? extends E> p)
Returns the error if this class Result is class Err, otherwise default.
Haskell: Result.fromRight
class Err, otherwise default.class Result,
class Err,
Result.fromRightpublic static <V,E> V getOrElse(Result<? extends V,? extends E> $receiver, kotlin.jvm.functions.Function1<? super E,? extends V> transform)
Returns the value if this class Result is class Ok, otherwise
the transformation of the error.
public static <V,E> E getErrorOrElse(Result<? extends V,? extends E> $receiver, kotlin.jvm.functions.Function1<? super V,? extends E> transform)
Returns the error if this class Result is class Err, otherwise
the transformation of the value.
class Result,
class Err