> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Result

> Kotlin Sealed Interface

**Sealed Interface**

```kotlin theme={null}
sealed interface Result<out T, out E>
```

## Functions

### flatMap

```kotlin theme={null}
inline fun <T, E, R> Result<T, E>.flatMap(transform: (T) -> Result<R, E>): Result<R, E>
```

### fold

```kotlin theme={null}
inline fun <T, E> Result<T, E>.fold(onSuccess: (T) -> Unit, onFailure: (E) -> Unit)
```

### getOrNull

```kotlin theme={null}
fun <T, E> Result<T, E>.getOrNull(): T?
```

### getOrThrow

```kotlin theme={null}
fun <T, E> Result<T, E>.getOrThrow(): T
```

### map

```kotlin theme={null}
inline fun <T, E, R> Result<T, E>.map(transform: (T) -> R): Result<R, E>
```

### mapError

```kotlin theme={null}
inline fun <T, E, F> Result<T, E>.mapError(transform: (E) -> F): Result<T, F>
```
