struct

Result(T)

Inherits Struct / Value / Object

Wrap a value into a Result (like in Rust).

Constructors

Class methods

err?

Returns true if current Result class is Err, false otherwise.

Source
ok?

Returns true if current Result class is Ok, false otherwise.

Source

Instance methods

err?

Returns true if current Result instance is Err, false otherwise.

Source
initialize
Source
ok?

Returns true if current Result instance is Ok, false otherwise.

Source
state

Extract the Result state (type, status and value). Inspired by the Elixir lang approach, it's handy for the pattern matching.

Source
status

Result status as a Symbol (:done or :fail, etc).

Source
status?(s : Symbol) : Bool

Checks a status.

res.status?(:done)
res.status?(:fail)
Source
type

Result type as a Symbol (:ok or :err).

Source
unwrap

Unwrap the result value (like Result::unwrap in Rust).

Source
value

Returns the result value.

Source