Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Result.isOk

$r.isOk() -> boolean

Description

Returns true if the Result object has a valid value and is not in a fail state.

$result = searchForUser()

if $result.isOk() {
    $user = $result.get()

    // (do something with the return value)
}
else {
    print('Failed with code: ' ~ $result.getFailCode())
}

See Also