Skip to content

True Myth / result / Matcher

Type Alias: Matcher<T, E, A>

Matcher<T, E, A> = object

A lightweight object defining how to handle each variant of a Result.

Type Parameters

T

T

The success type

E

E

The error type

A

A

The type resulting from calling match on a Result

Properties

Err()

Err: (error) => A

Transform an E into the resulting type A.

Parameters

error

E

Returns

A


Ok()

Ok: (value) => A

Transform a T into the resulting type A.

Parameters

value

T

Returns

A