Result
in package
AbstractYes
Tags
Table of Contents
Methods
- Err() : Result<never, F>
- flatMap() : Result<U, E>
- get() : Option<string|int, T>
- isErr() : bool
- isErrAnd() : bool
- isOk() : bool
- isOkAnd() : bool
- map() : Result<U, E>
- mapErr() : Result<T, F>
- mapOr() : U
- Ok() : Result<U, never>
- try() : Result<O, Throwable>
- unwrap() : T
- Returns the Ok value. In the Err case, if the error value if throwable, it is thrown.
- unwrapErr() : E
- Returns the Err value, Throws otherwise.
- unwrapOr() : T
- unwrapOrElse() : T
- Get the value if Ok. Returns the result of the given callback otherwise.
- with() : Result<O, F>
Methods
Err()
public
final static Err(F $error) : Result<never, F>
Parameters
- $error : F
Tags
Return values
Result<never, F>flatMap()
public
abstract flatMap(callable $f) : Result<U, E>
Parameters
- $f : callable
Tags
Return values
Result<U, E>get()
public
abstract get() : Option<string|int, T>
Return values
Option<string|int, T>isErr()
public
abstract isErr() : bool
Tags
Return values
boolisErrAnd()
public
abstract isErrAnd(callable $predicate) : bool
Parameters
- $predicate : callable
Tags
Return values
boolisOk()
public
abstract isOk() : bool
Tags
Return values
boolisOkAnd()
public
abstract isOkAnd(callable $predicate) : bool
Parameters
- $predicate : callable
Tags
Return values
boolmap()
public
abstract map(callable $f) : Result<U, E>
Parameters
- $f : callable
Tags
Return values
Result<U, E>mapErr()
public
abstract mapErr(callable $f) : Result<T, F>
Parameters
- $f : callable
Tags
Return values
Result<T, F>mapOr()
public
abstract mapOr(U $default, callable $f) : U
Parameters
- $default : U
- $f : callable
Tags
Return values
UOk()
public
final static Ok(U $value) : Result<U, never>
Parameters
- $value : U
Tags
Return values
Result<U, never>try()
public
final static try(callable $procedure) : Result<O, Throwable>
Parameters
- $procedure : callable
Tags
Return values
Result<O, Throwable>unwrap()
Returns the Ok value. In the Err case, if the error value if throwable, it is thrown.
public
abstract unwrap() : T
Otherwise, throws RuntimeException.
Tags
Return values
TunwrapErr()
Returns the Err value, Throws otherwise.
public
abstract unwrapErr() : E
Tags
Return values
EunwrapOr()
public
abstract unwrapOr(T $default) : T
Parameters
- $default : T
Return values
TunwrapOrElse()
Get the value if Ok. Returns the result of the given callback otherwise.
public
abstract unwrapOrElse(callable $fallback) : T
Parameters
- $fallback : callable
Return values
Twith()
public
final static with(callable $expr) : Result<O, F>
Parameters
- $expr : callable