Result

A type which wraps a value and a potential error.

Alias This

isOK

Members

Functions

get
T get()

Gets the value stored within the Result.

getOr
T getOr(T value)

Gets the value stored within the Result if non-error, otherwise returns the given value.

Properties

error
string error [@property getter]

The error stored within the Result.

isOK
bool isOK [@property getter]

Whether the result is successful.

Static functions

makeError
typeof(this) makeError(string message)

Creates an error value.

makeOk
typeof(this) makeOk(T value)

Creates an "ok" value.

Meta